Legacy 旧版mongo Shell

On this page本页内容

Warning警告

The mongo shell has been deprecated in MongoDB v5.0. MongoDB v5.0中已弃用mongo shell。The replacement is mongosh.替代者是mongosh

Older mongo shell documentation is included with the corresponding documentation for that MongoDB release.较早的mongoshell文档包含在MongoDB版本的相应文档中。

Quick Links to prior versions到早期版本的快速链接

Comparison of the mongo Shell and mongoshmongo-Shell和mongosh的比较

The new MongoDB Shell (mongosh) offers numerous advantages over the legacy mongo shell, such as:新的MongoDB Shell(mongosh)与传统的mongoshell相比具有许多优势,例如:

  • Improved syntax highlighting.改进了语法高亮显示。
  • Improved command history.改进了命令历史记录。
  • Improved logging.改进了日志记录。

mongosh currently supports a subset of the legacy mongo shell methods. mongosh目前支持遗留mongoshell方法的一个子集。To maintain backwards compatibility, the methods that the new mongosh supports use the same syntax as the corresponding methods in the legacy mongo shell.为了保持向后兼容性,新mongosh支持的方法使用与传统mongoshell中相应方法相同的语法。

The list of methods supported by mongosh is here: MongoDB Shell Methods.mongosh支持的方法列表如下:MongoDB Shell方法

Tip提示
See also: 参阅:
←  ClientEncryption.decrypt()Configure the mongo Shell →