title: Running arbitrary MongoDB scripts through Node.js driver
body: <p>I have a combination of complex MongoDB scripts that runs from the command line as follows: </p>
  
  <pre><code>$ mongo mydb config.js task.js
  </code></pre>
  
  <p>Since I can't run shell scripts in my server environment and need to schedule the above task, I figured I could simply concatenate the above .js files and then run them from a Node script. Hence I am looking for an equavalent to:</p>
  
  <pre><code>db.runMyCustomRawCommands(string commands)
  </code></pre>
  
  <p>How can I do this, or what would be an alternative solution?</p>