- Reference >
- mongoShell Methods >
- Native Methods >
- isInteractive()
isInteractive()¶
On this page
- 
isInteractive()¶
- New in version 4.2. - Returns a boolean value indicating if the current - mongoshell is running in interactive mode or in script mode:- trueif in interactive mode
- falseif 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: