访问 mongo Shell 帮助

在本页面

除了MongoDB Manual中的文档之外,mongo shell 在其“在线”帮助系统中提供了一些其他信息。本文档概述了访问此帮助信息的过程。

命令行帮助

要查看选项列表和启动mongo shell 的帮助,请从命令行使用--help选项:

mongo --help

Shell Help

要查看帮助列表,请在mongo shell 中键入help

help

Database Help

mongo shell 中:

show dbs

show databasesshow dbs的别名。

db.help()
db.updateUser

Collection Help

mongo shell 中:

show collections
db.collection.help()

<collection>可以是存在的集合的名称,尽管您可以指定不存在的集合。

db.collection.save

Cursor Help

mongo shell 中使用find()方法执行read operations时,可以使用各种游标方法来修改find()行为,并可以使用各种 JavaScript 方法来处理从find()方法返回的游标。

db.collection.find().help()

<collection>可以是存在的集合的名称,尽管您可以指定不存在的集合。

db.collection.find().toArray

处理游标的一些有用方法是:

有关迭代游标和从游标中检索文档的示例,请参见cursor handling。有关所有可用的游标方法,另请参见Cursor

包装对象帮助

要获取mongo shell 中可用的包装器类的列表,例如BinData(),请在mongo shell 中键入help misc

help misc
首页