您的位置:首页 > 博客中心 > 数据库 >

mongodb之find格式化打印

时间:2022-03-10 18:10

未格式化打印

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


格式化打印

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


修改文件,使得find可直接格式化打印

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

待续。。。。

本文出自 “” 博客,请务必保留此出处

mongodb之find格式化打印,布布扣,bubuko.com

热门排行

今日推荐

热门手游