十、帮助

  后,使用说明()来指导你如何在MongoDB做的事情。

  10.1 help – All available commands.

  10.1 帮助 -所有可用的命令。

> help
db.help()                    help on db methods
db.mycoll.help()             help on collection methods
rs.help()                    help on replica set methods
help admin                   administrative help
help connect                 connecting to a db help
help keys                    key shortcuts
//...

  > 帮助

  db.help()                    帮助DB方法   db.mycoll.help()             帮助收集方法   rs.help()

  副本一套方法

  帮助帮助admin管理员的帮助

  帮助连接到一个数据库帮助

  帮助键快捷键

/ /...
10.2 db.help() -显示help 在db上。
> db.help()
DB methods:
db.addUser(username, password[, readOnly=false])
db.auth(username, password)
db.cloneDatabase(fromhost)
db.commandHelp(name) returns the help for the command
db.copyDatabase(fromdb, todb, fromhost)
//...

  10.3 显示集合(表)的帮助。

> db.users.help()
DBCollection help
db.users.find().help() - show DBCursor help
db.users.count()
db.users.dataSize()
db.users.distinct( key ) - eg. db.users.distinct( 'x' )
db.users.drop() drop the collection
db.users.dropIndex(name)
//...
>db.users.help()
DBCollection,帮助
db.users.find()帮助()-秀DBCursor的帮助
db.users.count()
db.users.dataSize()
db.users.distinct(键)-例如。db.users.distinct( 'X' )
db.users.drop()删除集合   db.users.dropIndex(名称)
/ /...

  10.4 -显示功能的帮助。

> db.users.find().help()
find() modifiers
.sort( {...} )
.limit( n )
.skip( n )
.count() - total # of objects matching query, ignores skip,limit
.size() - total # of objects cursor would return, honors skip,limit
.explain([verbose])
//...
>db.users.find()()

  ()帮助修饰符   排序( {...} )(n)的

  限制    。跳过(n)的

  。计数()-总#查询匹配的对象,忽略跳过,限制

  大小()-总#的对象光标将返回,荣誉跳过,限制

  解释([详细])

  / /...

  完成。希望本摘要MongoDB的命令可以帮助别人。