Expand the bit on Akshat's answer. The URI string that meteor mongo --url is the MongoDB Connection String . It's a little surprising that the mongo shell itself does not support this format. This has been reported as an error ; also see this answer .
It would be nice if meteor mongo had a way to pass parameters not directly related to the mongo shell. Following the common Unix idiom, it might be something like this:
meteor mongo myapp.meteor.com -- myscript.js --some-other-mongo-parameter
But this does not work (I sent a function request ).
I wrote a handy wrapper for all mongo shell shell commands. You can install it using NPM:
npm install -g mmongo
If you are not using NPM, this is just one file that needs to be dropped somewhere in your $PATH ; see README on Github .
Now you can do:
mmongo myapp.meteor.com myscript.js
Also see this answer for some examples.
(In Ruby, there was previously a less recognized script, see this Gist .)
source share