@songying
2017-10-04T12:09:44.000000Z
字数 492
阅读 1267
mongodb
sudo service mongod start //开启mongodbsudo service mongod stop //关闭mongodbsudo service mongod restart //重启mongodb
.pretty() //以格式化打印结果.print() //以无格式打印.printjson() //以json格式打印
quit()或 ctrl + c 退出shell
mongo --helphelp //在mongo shell中查看帮助列表db.help() //查看db对象可用方法的帮助列表db.方法名 //不带括号时是查看该方法在shell中的实现db.<collection>.help() //查看集合对象的可用方法的帮助db.<collection>.<method> //不带括号时查看集合方法的实现db.collection.find().help() //列出集合中所有修改器和游标处理方法db.<collection>.find().<method> //查看游标方法的实现
