???????????

????????????????????????????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?????????????????