title: How to return Mongodb js return value to shell script
body: <p>I m getting started with MongoDb scripting. My requirement is to query the mongodb for a process status and based on it kick start another process, in shell script. I ve written the following js to query and return the value from mongodb :</p>
  
  <pre><code>var statusValue=db.Collections.find({"Name":"UV"},{Status:1,_id:0}).sort({Sequence:-1}).limit(1).map( function(u) { return u.Status; } );
  
  print (statusValue);
  </code></pre>
  
  <p>I call this js from a shell script. Is there a way to return the value of 'statusValue' to the calling shell?</p>