Get the App
SLTechnology News&Howtos  ›  Database  › 

Find format printing of mongodb

Shulou Source: shulou.com Published: 2022-06-01 21:19:28 11月16日 Update

Unformatted printing

> db.games.find () {"_ id": ObjectId ("53d077372826c5d3aae7ad6a"), "game": "pinball", "user": "joe", "score": 5050}

Formatted printing

> db.games.find () .pretty () {"_ id": ObjectId ("53d077372826c5d3aae7ad6a"), "game": "pinball", "user": "joe", "score": 5050} >

Modify the file so that find can format the print directly

[root@server ~] # echo "DBQuery.prototype._prettyShell = true" > > ~ / .mongorc.js

To be continued.

Tags: Format fil Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology MySQL Redmi Apple MariaDB