MongoDB
 sql >> Database >  >> NoSQL >> MongoDB

MongoDB NumberLong/$numberLong problema durante la riconversione in Java Object

Possiamo usare sotto il codice:

Document doc = documentCursor.next();
JsonWriterSettings relaxed = JsonWriterSettings.builder().outputMode(JsonMode.RELAXED).build();
CustomeObject obj = gson.fromJson(doc.toJson(relaxed), CustomeObject.class);