title: How to run a local script in mongo shell - Solution load()
body: <p>I think this is a very basic question but I'm stuck. I'm connected to remote mongo instance (mLab) via a MongoDB shell. This has been fine for one-liners, but now I want to run larger commands but often, thus the need to do it from an already connected shell. </p>
  
  <p>How can I run my local script.js from the mongo shell and get the output in the shell, as if I'm just running the one-liner per usual?</p>
  
  <p>I was hoping load("script.js") would do it, but it just returns 'true' regardless of the content.</p>