We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e25b6a9 commit 5725ed6Copy full SHA for 5725ed6
source/reference/methods.txt
@@ -837,6 +837,19 @@ Native Methods
837
838
- Description
839
840
+ * - :manual:`load() </reference/method/load/>`
841
+
842
+ - Loads and runs a JavaScript file in the shell.
843
844
+ In ``mongosh``, scripts loaded with the ``load()`` method support
845
+ the ``__filename`` and ``__dirname`` Node.js variables. These
846
+ variables return the file name and directory of the loaded
847
+ script, respectively. The returned values are always absolute
848
+ paths.
849
850
+ In the legacy shell, you cannot not access the script's file name
851
+ or directory using the ``load()`` method.
852
853
* - ``print()``
854
855
- Print the specified text or variable. ``print()`` and ``printjson()``
0 commit comments