title: Inserting JSON.Stringified data into MongoDB
body: <pre><code>var obj = {};
  obj.url = hostNames[i];
  obj.statusCode = res.statusCode;
  obj.headers = res.headers;
  
  db.collection.save(JSON.stringify(obj, null, 2));
  </code></pre>
  
  <p>I am currently attempting to request a HTTP response via Node.js, and then parsing that output into a MongoDB with <code>JSON.stringify</code> (a method that transforms things into JSON document format). For some reason, I am getting some weird output in MongoDB, it goes something like this: </p>
  
  <pre><code>&gt; db.scrape.find()
  { "_id" : ObjectId("51472849650593014a3c20da"), "0" : "{", "1" : "\n", "2" : " ", "3" : " ", "4" : "\"", "5" : "u", "6" : "r", "7" : "l", "8" :
  </code></pre>
  
  <p>What I think it is doing is that it is interpreting each char as a new variable. What did I do wrong in my code? </p>