zabouti
zabouti

Reputation: 639

using a mongo script from inside the javascript shell?

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

Upvotes: 6

Views: 2399

Answers (1)

Karoly Horvath
Karoly Horvath

Reputation: 96306

Use: load("anotherscript.js")

Upvotes: 9

Related Questions