Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

using a mongo script from inside the javascript shell?

Tags:

shell

mongodb

I know how to run a mongodb script from the command line and then enter the shell. E.g.,

mongo --shell dbname dbnameinit.js

But once I'm inside the shell, can I execute another script? Anything like db.dbname.load("anotherscript.js")???

Thanks! -- ge

like image 216
zabouti Avatar asked Jul 12 '11 21:07

zabouti


1 Answers

Use: load("anotherscript.js")

like image 153
Karoly Horvath Avatar answered Sep 22 '22 19:09

Karoly Horvath