Legacy mongo
Shell
On this page
Warning
The mongo
shell has been deprecated in MongoDB v5.0. The
replacement is mongosh
.
Older mongo
shell documentation is included with the
corresponding documentation for that MongoDB
release.
For the legacy mongo
shell documentation, refer to the
legacy documentation
for the corresponding MongoDB Server release.
Comparison of the mongo
Shell and mongosh
The new MongoDB Shell (mongosh
) offers numerous
advantages over the legacy mongo
shell, such as:
Improved syntax highlighting.
Improved command history.
Improved logging.
mongosh
currently supports a subset of the legacy
mongo
shell methods. To maintain backwards
compatibility, the methods that the new mongosh
supports use the
same syntax as the corresponding methods in the legacy
mongo
shell.
The list of methods supported by mongosh
is here:
MongoDB Shell Methods.