Printing full BSON object with --eval

1,739 views
Skip to first unread message

Andi

unread,
Feb 14, 2011, 11:31:42 AM2/14/11
to mongodb-user
$ mongo rlp --eval "db.stats()+''"
MongoDB shell version: 1.6.5
connecting to: rlp
[object bson_object]


In the shell I get a full print, from bash I just see this. I cannot
find any methods of bson_object.

Kyle Banker

unread,
Feb 14, 2011, 11:33:51 AM2/14/11
to mongod...@googlegroups.com
Try this:
mongo --eval "printjson(db.stats())"

> --
> 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.
>
>

Andreas Jung

unread,
Feb 14, 2011, 11:35:17 AM2/14/11
to mongod...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Andi wrote:
> $ mongo rlp --eval "db.stats()+''"
> MongoDB shell version: 1.6.5
> connecting to: rlp
> [object bson_object]
>

use printjson(db.stats())

- -aj
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQGUBAEBAgAGBQJNWVnFAAoJEADcfz7u4AZjrkQLwLcUzRGJH2RS9epEZcG8Lb5F
6LEPyxPCHtK8RjNG44yZH6yv5L63gMFs6vd6QY0vqD9dambOj48fhKT6xj0YNzbV
qJhwgeS5zmeEnrkg8zkJEopy5Rb+/87xIjTmyitfN0/Mb8AGSsGDvNyCJypBdfIj
i38if5fL5PzjSctKMkmR+Yc7CaWme7zVmzo+dnoXGEKs4xqAC6vArqBVLIExokxe
M1QicZRRxwWvRHw/dPtSFcLYfnl1QMhZZJf9VqJQCChEtsAYUnKX27o8ULFvq+2d
5Cs4dteCA9MH9xJKFYO2lOXbaRAghnin6fRhVq7kizDZemW09S1NVqLqcFnuVW9R
iT5ThCiB4+taL4DgZVsdo7FMHnPhpAO+YNy4risWEgKUTv5rpNowqmCOeMbyaM9I
f/GQYFEblorbAr9suoWFmx5NziJGJT3JszIoXTL0O7mKFispuWhX4tIVcSgSlQtD
BZYWvH582XbJS9va0+MABYKtAgreBqo=
=dwU2
-----END PGP SIGNATURE-----

lists.vcf
Reply all
Reply to author
Forward
0 new messages