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
mongodb://127.0.0.1:3001/meteor
> mongo --quiet mongodb://127.0.0.1:3001/meteor --eval 'db.users.find().count()'
0
excellent! that works like a charm
Or, as a one-liner:
mongo --quiet $(meteor mongo --url) --eval 'db.users.find().count()'