Native Methods in
The methods listed in this section are
replacements for the native methods that were available in the legacy
mongo shell. These methods are not exact replacements: output
formats and some functionality may differ from the corresponding
In addition to these methods, the mongocompat snippet
provides access to legacy
mongo shell APIs.
In the following table
<filename> are strings and
should be in quotes.
// process.chdir( <path> ) process.chdir( "./data/incoming" )
Legacy Method Name
Returns the contents of the specified file
Changes the current working directory to the specified path.
Returns the hostname of the system running
Returns a document that reports memory used by the shell.
Returns the hostname of the computer running the shell.
Returns a boolean indicating whether
Returns an array of documents that give the name and type of each object in the directory.
Returns a list of the files in the current directory.
Returns the md5 hash of the specified file.
Creates a directory at the specified path.
Returns the current directory.
Exits the current shell session.
Removes the specified file from the local file system.
Sleep for the specified number of milliseconds.
Returns the current version of
Returns a random number between