On this page本页内容
mkdir
(path)¶Creates a directory at the specified path. This method creates the entire path specified if the enclosing directory or directories do not already exit. The user running the mongo
shell must have permission to create directories in the specified path.
This method is equivalent to mkdir -p with BSD or GNU utilities.
The mkdir()
method has the following parameter:
path |
string | A path on the local filesystem. |
New in version 3.4.版本3.4中的新功能。
mkdir()
returns a document with information about the result of the operation.
On success, mkdir()
returns the following:
If the directory at the specified path already exists, mkdir()
returns the following:
The following command creates a directory called foo
in the shell’s current working directory.
The above command returns the following output: