mongo -eval output?

423 views
Skip to first unread message

chriskessel

unread,
Jan 14, 2011, 12:04:50 PM1/14/11
to mongodb-user
This seems like a simple thing, but I can't figure out. If I use mongo
with -eval, how can I get output? I have some scripts I'd like to run,
but I need the output. The output just gives me [object bson_object].
I was expecting what I'd see if I gave the command in the shell
interactively.

$ ./mongodb-linux-x86_64-1.6.5/bin/mongo -port 10000 -eval
"rs.status()"
MongoDB shell version: 1.6.5
connecting to: 127.0.0.1:10000/test
type "help" for help
[object bson_object]
$

Thanks,
Chris

Scott Hernandez

unread,
Jan 14, 2011, 12:12:15 PM1/14/11
to mongod...@googlegroups.com
./mongodb-linux-x86_64-1.6.5/bin/mongo -port 10000 -eval
"printjson(rs.status())"

> --
> You received this message because you are subscribed to the Google Groups "mongodb-user" group.
> To post to this group, send email to mongod...@googlegroups.com.
> To unsubscribe from this group, send email to mongodb-user...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.
>
>

Reply all
Reply to author
Forward
0 new messages