Skip to content

Instantly share code, notes, and snippets.

> 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?
db.presents.insert( {
_id: "skate_board_434",
color: "blue",
for: "Mariott"
} ) -> results in an error since it's missing `present_for` field
//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",
//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",
db.runCommand({
collMod: "contacts",
validator: {
$and: [
{year_of_birth: {$lte: 1994}},
{$or: [
{phone: { $type: "string" }},
{email: { $type: "string" }}
]}]
}})
{
"highestPrice": 1350000,
"lowestPrice": 125000,
"averagePrice": 410593,
"priceStdDev": 182358,
"Year": 2015
},
...
{
"highestPrice": 930000,
db.postcodes.aggregate([
{
$geoNear:
{
near:
{
"type": "Point",
"coordinates": [
51.5156725,
-0.727387
{
"_id": 1995,
"neighbours": [
"SL6 2NL",
"SL6 2JL",
"SL6 2NB",
"SL6 2JN",
"SL6 2NA"
]
}
db.postcodes.createIndex({location: "2dsphere"})
db.hottestLocations.find().forEach(function(myDoc) {
var myCursor = findNeighbours(myDoc.Location[0], myDoc.Year);
myCursor.forEach(printjson);
})