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()
var cursor = db.collection.find().sort({_id:-1}).limit(10000); while(cursor.hasNext()){ printjsononeline(cursor.next()); }