Solutions Architect @ MongoDB | chris.grabosky@mongodb.com
Deck & Content | l.gsky.us/#!mdbmsft2018
Registration Link | l.gsky.us/#!mdbmsft2018reg
Click Here For Printable Version
Key | Value |
---|---|
Server | mdbazuretraining-v9iwf.azure.mongodb.net |
SRV Record | Yes on Switch |
Authentication | Username/Password |
Username | azureacct |
Password | azurepasswd |
Auth DB | admin |
Question | Answer |
---|---|
From 1987 | {year:1987} |
"Comedy" as one of their genres | {genre:"Comedy"} |
"Comedy" as only genre | {genres:["Comedy"]} |
"Comedy" or "Drama" | {genres:{$in:["Comedy", "Drama"]}} |
"Comedy" and "Drama | { genres: { $all: ["Comedy", "Drama"] } } |
IMDB Rating > 8.0 and PG Rating | {"imdb.rating" : {$gt: 8.0}, rated:"PG"} |
Whole title of "Dr. Strangelove" | {title: {$regex: '^Dr. Strangelove'}} |
db.createIndex({"address.zipcode":1, "cuisine":1, "stars":1})
.find({"address.zipcode": {$gt: '5000'}, cuisine: 'Sushi'}).sort({stars:-1})versus
.find({"address.zipcode": '5000', cuisine: 'Sushi'}).sort({stars:-1})
db.createIndex({"cuisine":1, "stars":1, "address.zipcode":1})
Question | Answer |
---|---|
That Are Comedies | $match {genres:"Comedy"} |
Have a rating | $match {rated:{$exists:true}} |
Just the title and how many years old | $project { _id:0, title:1, yearsOld: { $subtract: [2018,"$year"]} } |
Stage 1 | $project { title:1, actors:1,_id:0 } |
Stage 2 | $graphLookup { from: 'movies', startWith: "$actors", connectFromField: 'actors', connectToField: 'actors', as: 'foo', maxDepth: 1, depthField: 'degrees', restrictSearchWithMatch: {actors:"Kevin Bacon"} } |
Stage 3 | $project { title:1,actors:1,_id:0,"foo.title":1,"foo.actors":1,jumps:{$size:"$foo"} } |
Stage 4 | $match { jumps:{$gt:0} } |
App | Atlas Tech | Azure Tech | Link |
---|---|---|---|
Bowling Tracker | Query Anywhere WebHooks Trigger Functions | Web App | l.gsky.us/#!bowlsrc |
"Instagram" | Query Anywhere WebHooks Trigger Functions | Web App Azure Storage Xamarin App Cognitive Vision | l.gsky.us/#!igsrc |
"Tiny URL" | WebHooks | Web App | l.gsky.us/#!linksrc |