Pretty print in MongoDB shell as default

前端 未结 8 1777
予麋鹿
予麋鹿 2020-12-07 06:50

Is there a way to tell Mongo to pretty print output? Currently, everything is output to a single line and it\'s difficult to read, especially with nested arrays and document

8条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-07 07:10

    (note: this is answer to original version of the question, which did not have requirements for "default")

    You can ask it to be pretty.

    db.collection.find().pretty()
    

提交回复
热议问题