6

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

1 Answer 1

9

Use: load("anotherscript.js")

Sign up to request clarification or add additional context in comments.

1 Comment

Yep, it worked. Weird - I swear I tried that before. Thanks for getting me to try it again, yi_H!!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.