Pass parameters to meteor mongo from the shell


How can I pass parameters to meteor mongo as I would do with mongo? for instance with a normal mongo,

$ mongo --eval "db.users.find({}).count()"

works but

$ meteor mongo --eval "db.users.find({}).count()"

fails because meteor mongo only accept a --url parameter


you can use the output of mongo --url and feed it to mongo --eval, no?

> meteor mongo --url
> mongo --quiet mongodb:// --eval 'db.users.find().count()'


excellent! that works like a charm


Or, as a one-liner:

mongo --quiet $(meteor mongo --url) --eval 'db.users.find().count()'