title: Any build-in JSON.parse in MongoDB?
body: <p>Is there any Mongo (command line) function that I can turn a string into object? e.g. JSON.parse or something like that?</p>
  
  <p>db.sessions.update({}, {'$set':{ 'extra':JSON.parse(stringData)   }});</p>
  
  <hr>
  
  <p>my solution:</p>
  
  <pre><code>function my_extra() {
    db.tempData.find().forEach( function(obj) {
                         obj.extra = db.eval(obj.myString);
                         db.tempData.save(obj);
                       } );
  };
  
  my_extra();
  </code></pre>
  
  <p>However, I try this: db.tempData.update({}, {'$set':{ 'extra':db.eval(myString)   }});
  but it doesn't work.. saying myString is not defined.
  so i use this.myString but doesn't work neither.  that's why I have to use the function.</p>
  
  <p>is there a way to reference myString in the second parameter?</p>