I\'m using mongodb 2.2.0 and am trying to print json in a single line as opposed to \"pretty\" printing using printjson() or find().pretty(). i.e.
printjson()
find().pretty()
Here is what I use from the command line
mongoexport -d $dbname -c $collection -q '{ "id" : -1 }'
Not sure you can /sort /limit it