load()
Definition
The load()
method has the following parameter:
ParameterTypeDescriptionfilename
stringSpecifies the path of a JavaScript file to execute.
Specify filenames with relative or absolute paths. When usingrelative path names, confirm the current directory using thepwd()
method.
After executing a file with load()
, you may reference anyfunctions or variables defined the file from the mongo
shell environment.
Example
Consider the following examples of the load()
method:
- load("scripts/myjstest.js")
- load("/data/db/scripts/myjstest.js")