This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> db.test.find() | |
{ "_id" : { "a" : 1234, "b" : 5678 } } | |
> db.test.find( { _id : { b : 5678, a : 1234 } } ) <- No Match! Wuh? | |
> db.test.find( { _id : { a : 1234, b : 5678 } } ) <- But this does? What"s the diff? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
db.presents.insert( { | |
_id: "skate_board_434", | |
color: "blue", | |
for: "Mariott" | |
} ) -> results in an error since it's missing `present_for` field |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//japan team | |
ruby | |
focus on 2 languages | |
japanese | |
english | |
schema design for present requests | |
{ | |
_id: { inc: 5535345, name: "Maneki Neko"} | |
shape: "Round" | |
receiver: "Shinobu Tsukasa", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//brazil team | |
node.js | |
focus on 4 languages | |
portuguese | |
spanish | |
french | |
dutch - yes, surinam and the duct antilles are located in SA! | |
schema design for present requests | |
{ | |
_id: "surf_board_12334244", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
db.runCommand({ | |
collMod: "contacts", | |
validator: { | |
$and: [ | |
{year_of_birth: {$lte: 1994}}, | |
{$or: [ | |
{phone: { $type: "string" }}, | |
{email: { $type: "string" }} | |
]}] | |
}}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"highestPrice": 1350000, | |
"lowestPrice": 125000, | |
"averagePrice": 410593, | |
"priceStdDev": 182358, | |
"Year": 2015 | |
}, | |
... | |
{ | |
"highestPrice": 930000, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
db.postcodes.aggregate([ | |
{ | |
$geoNear: | |
{ | |
near: | |
{ | |
"type": "Point", | |
"coordinates": [ | |
51.5156725, | |
-0.727387 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"_id": 1995, | |
"neighbours": [ | |
"SL6 2NL", | |
"SL6 2JL", | |
"SL6 2NB", | |
"SL6 2JN", | |
"SL6 2NA" | |
] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
db.postcodes.createIndex({location: "2dsphere"}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
db.hottestLocations.find().forEach(function(myDoc) { | |
var myCursor = findNeighbours(myDoc.Location[0], myDoc.Year); | |
myCursor.forEach(printjson); | |
}) |