title: Validate JSON from Mongo?
body: <p>I want to check if the text a user enters is valid JSON. I know I can easily do that using something like this:</p>
  
  <pre><code>function IsJsonString(str) {
      try {
          JSON.parse(str);
      } catch (e) {
          return false;
      }
      return true;
  }
  </code></pre>
  
  <p>My problem is with JSON that comes from Mongo, which is wrapped in <code>ObjectId</code>, <code>ISODate</code>, i.e.:</p>
  
  <pre><code>{
      "_id" : ObjectId("5733b42c66beadec3cbcb9a4"),
      "date" : ISODate("2016-05-11T22:37:32.341Z"),
      "name" : "KJ"
  }
  </code></pre>
  
  <p>This is not valid JSON. How could I go about validating JSON while allowing something like the above?</p>