title: Serializing nested documents mongoDB to Jackson
body: <p>so I am using Jackson (together with Mongojack) to create POJO's of MongoDB Documents. My database looks something like this:</p>
  
  <pre><code>Document{ id:1, Document2{ value1:1 value2:2}}
  </code></pre>
  
  <p>I have created a POJO for Document, and for Document 2, and this generally works fine. The problem is that some places in my Database, Document2 has a value of NaN instead of being a nested document with several values, which leads to this error</p>
  
  <pre><code>ERROR [2015-07-21 16:01:26,809] io.dropwizard.jersey.errors.LoggingExceptionMapper: Error handling a request: 3b38d500d7657352
  ! com.fasterxml.jackson.databind.JsonMappingException: Can not instantiate value of type [simple type, class com.document1.document2] from Floating-point number (NaN); no one-double/Double-arg constructor/factory method
  
  !  at [Source: de.undercouch.bson4jackson.io.LittleEndianInputStream@534093c6; pos: 1975] (through reference chain: com.document1["document2"])
  ! at com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:148) ~[jackson-databind-2.5.1.jar:2.5.1]
  </code></pre>
  
  <p>Not really sure what the best way to go about fixing this is. I guess what I'd want is for Jackson to recognize if Document2 is just :nan instead of a nested document, and just serialize it with no values or something? </p>