- Reference >
mongo
Shell Methods >- Native Methods >
- isInteractive()
isInteractive()¶
On this page
-
isInteractive
()¶ New in version 4.2.
Returns a boolean value indicating if the current
mongo
shell is running in interactive mode or in script mode:true
if in interactive modefalse
if in script mode
Examples¶
Script Mode¶
Create a JavaScript testExample.js
file with the content:
From a terminal/command-line prompt (i.e. not inside the
mongo
shell), specify the javascript file to the
mongo
shell to execute the file:
The operation prints to the terminal information about the MongoDB shell version and various information followed by: