title: Converting (.net) BsonDocument string into a (java) DBObject
body: <p>In a publishing flow I need to insert a DBObject into a mongo db collection using Java.</p>
  
  <p>I receive the object as a String, and this has been passed to me from a .NET application that used <code>article.ToBsonDocument().ToJson()</code> on a POCO.</p>
  
  <p>On my side of the flow, in Java, I tried just using <code>BasicDBObject doc = (BasicDBObject) JSON.parse(content);</code> but I get a <code>com.mongo.util.JSONParseException</code> on a Date:</p>
  
  <pre><code>"CreationDate" : ISODate("2013-03-18T08:50:53Z")
  </code></pre>
  
  <p>I can change how the content is generated in C#, and I can change how to write to the DB in java, my only constraint is that it must be passed as a string between the two systems.</p>
  
  <p>Any suggestions?</p>
  
  <p><strong>EDIT</strong> Thanks to the tip from @Jim Dagg below, some googling for ISODate and BsonDocument turned out <a href="https://groups.google.com/forum/?fromgroups=#!topic/mongodb-csharp/Leido2oPTKA" rel="nofollow">this gem</a>. Changing the c# code to use</p>
  
  <pre class="lang-cs prettyprint-override"><code>article.ToBsonDocument().ToJson(new JsonWriterSettings{OutputMode = JsonOutputMode.Strict});
  </code></pre>
  
  <p>fixed it.</p>