I can run the script in the specific database like
mongo main myscript.js<br/>
where main is a database name. The same thing I am unable to run inside the script like
myscript.js
use main; // not taking, throw error when using "mongo myscript.js"
Use this in your script
The default DB is
test. This statement gets a “sibling” database oftest.