mongodb shell games: here be dragons .. and javascript!
DESCRIPTION
Lightning talk on using and extending MongoDB's "mongo" interactive JavaScript shell. First presented at MongoDB Melbourne 2012: http://www.mongodb.com/events/mongodb-melbourne. This includes some basic tips & tricks through to adding plugins and other goodies. Applicable to MongoDB 2.2+, although Date.toISOString() is now a built-in in MongoDB 2.4+ due to the upgraded V8 JavaScript interpreter.TRANSCRIPT
![Page 2: MongoDB shell games: Here be dragons .. and JavaScript!](https://reader034.vdocument.in/reader034/viewer/2022052618/554bb18ab4c905b8618b5a75/html5/thumbnails/2.jpg)
2
![Page 3: MongoDB shell games: Here be dragons .. and JavaScript!](https://reader034.vdocument.in/reader034/viewer/2022052618/554bb18ab4c905b8618b5a75/html5/thumbnails/3.jpg)
3 Use the TAB, Luke!!
![Page 4: MongoDB shell games: Here be dragons .. and JavaScript!](https://reader034.vdocument.in/reader034/viewer/2022052618/554bb18ab4c905b8618b5a75/html5/thumbnails/4.jpg)
4
![Page 5: MongoDB shell games: Here be dragons .. and JavaScript!](https://reader034.vdocument.in/reader034/viewer/2022052618/554bb18ab4c905b8618b5a75/html5/thumbnails/5.jpg)
5 https://gist.github.com/stennie!)!
![Page 6: MongoDB shell games: Here be dragons .. and JavaScript!](https://reader034.vdocument.in/reader034/viewer/2022052618/554bb18ab4c905b8618b5a75/html5/thumbnails/6.jpg)
6 edit functionname!
![Page 7: MongoDB shell games: Here be dragons .. and JavaScript!](https://reader034.vdocument.in/reader034/viewer/2022052618/554bb18ab4c905b8618b5a75/html5/thumbnails/7.jpg)
7 ~/.mongorc.js!
![Page 8: MongoDB shell games: Here be dragons .. and JavaScript!](https://reader034.vdocument.in/reader034/viewer/2022052618/554bb18ab4c905b8618b5a75/html5/thumbnails/8.jpg)
8 http://skratchdot.com/projects/mongodb-schema/!
![Page 9: MongoDB shell games: Here be dragons .. and JavaScript!](https://reader034.vdocument.in/reader034/viewer/2022052618/554bb18ab4c905b8618b5a75/html5/thumbnails/9.jpg)
9 DBQuery.prototype._prettyShell = true;!
![Page 10: MongoDB shell games: Here be dragons .. and JavaScript!](https://reader034.vdocument.in/reader034/viewer/2022052618/554bb18ab4c905b8618b5a75/html5/thumbnails/10.jpg)
10
https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/toISOString!
![Page 11: MongoDB shell games: Here be dragons .. and JavaScript!](https://reader034.vdocument.in/reader034/viewer/2022052618/554bb18ab4c905b8618b5a75/html5/thumbnails/11.jpg)
11 http://stackoverflow.com/questions/8749971!
![Page 12: MongoDB shell games: Here be dragons .. and JavaScript!](https://reader034.vdocument.in/reader034/viewer/2022052618/554bb18ab4c905b8618b5a75/html5/thumbnails/12.jpg)
12
db.getSiblingDB(‘dbname’).collection.command!
![Page 13: MongoDB shell games: Here be dragons .. and JavaScript!](https://reader034.vdocument.in/reader034/viewer/2022052618/554bb18ab4c905b8618b5a75/html5/thumbnails/13.jpg)
13
www.mongodb.org/display/DOCS/dbshell+(mongo)+Reference!
![Page 14: MongoDB shell games: Here be dragons .. and JavaScript!](https://reader034.vdocument.in/reader034/viewer/2022052618/554bb18ab4c905b8618b5a75/html5/thumbnails/14.jpg)
14
system.js!
![Page 15: MongoDB shell games: Here be dragons .. and JavaScript!](https://reader034.vdocument.in/reader034/viewer/2022052618/554bb18ab4c905b8618b5a75/html5/thumbnails/15.jpg)
15
Many of the mongo shell commands are JS helpers .. call without ()!
![Page 16: MongoDB shell games: Here be dragons .. and JavaScript!](https://reader034.vdocument.in/reader034/viewer/2022052618/554bb18ab4c905b8618b5a75/html5/thumbnails/16.jpg)
16 https://github.com/TylerBrock/mongo-hacker!
![Page 17: MongoDB shell games: Here be dragons .. and JavaScript!](https://reader034.vdocument.in/reader034/viewer/2022052618/554bb18ab4c905b8618b5a75/html5/thumbnails/17.jpg)
17
• https://github.com/TylerBrock/mongo-hacker • https://github.com/karlseguin/MongoPlus • http://skratchdot.com/projects/mongodb-schema/ • http://skratchdot.com/projects/mesh/ • https://gist.github.com/stennie
– https://gist.github.com/3179786 – https://gist.github.com/3144323
• Ideas? Share .. !