mongodb print json without whitespace i.e. unpretty json

后端 未结 6 1136
礼貌的吻别
礼貌的吻别 2020-12-30 19:52

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.

6条回答
  •  一向
    一向 (楼主)
    2020-12-30 20:23

    Here is what I use from the command line

    mongoexport -d $dbname -c $collection -q '{ "id" : -1 }'
    

    Not sure you can /sort /limit it

提交回复
热议问题