title: MongoDB "NumberLong/$numberLong" issue while converting back to Java Object
body: <p>I am having a json which is somethink like <code>{"Header" : {"name" : "TestData", "contactNumber" : 8019071740}}</code></p>
  
  <p>If i insert this to mongoDB it will be something like </p>
  
  <p><code>{"_id" : ObjectId("58b7e55097989619e4ddb0bb"),"Header" : {"name" : "TestData","contactNumber" : NumberLong(8019071743)}</code></p>
  
  <p>When i read this data back and try to convert to java object using Gson it throws exception <code>com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected a long but was BEGIN_OBJECT at line 1 column 109 path $.Header.contactNumber</code></p>
  
  <p>I have found <a href="https://stackoverflow.com/questions/36134737/read-bson-mongodb-into-pojo-using-gson-and-typeadapter">this</a>, But i was wondering if i have very complex json structure then i might need to manipulate many json nodes in this approach.</p>
  
  <p>Do anyone has any better alternatives on this. </p>
  
  <p><strong>Edit:1</strong>
  I am reading querying and converting json as below</p>
  
  <pre><code>Document MongoDocument = mycollection.find(searchCondition);
  String resultJson =  MongoDocument.toJson();
  Gson gson = new Gson();
  Model model= gson.fromJson(resultJson, ItemList.class);
  </code></pre>