MongDB shell 命令

来源:互联网 发布:mac版百度云好友分享 编辑:程序博客网 时间:2024/06/05 11:09
db.help()                    help on db methodsdb.mycoll.help()             help on collection methodssh.help()                    sharding helpersrs.help()                    replica set helpershelp admin                   administrative helphelp connect                 connecting to a db helphelp keys                    key shortcutshelp misc                    misc things to knowhelp mr                      mapreduceshow dbs                     显示所有的数据库show collections             显示当前数据库的所有表show users                   show users in current databaseshow profile                 show most recent system.profile entries with time >= 1msshow logs                    show the accessible logger namesshow log [name]              prints out the last segment of log in memory, 'global' is defaultuse <db_name>                切换or创建一个数据库db.foo.find()                列出foo collection(表)上的所有对象db.foo.find( { a : 1 } )     列出foo表上所有a == 1的对象it                           result of the last line evaluated; use to further iterateDBQuery.shellBatchSize = x   set default number of items to display on shellexit                         quit the mongo shell
0 0
原创粉丝点击