MongoDB + Java - JSON parsing through com.mongodb.util.JSON.parse

I am using com.mongodb.util.JSON.parse to parse the JSON file into a DBObject. How to specify ids of dates, links and objects in a JSON file?

+6
source share
1 answer

Dates: { myDate: {$date: "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'" } } // Date in the specified string format ISODate.

Refs: { myRef : { $ref : <collname>, $id : <idvalue>[, $db : <dbname>] } } // collname is the name of the collection, idvalue is the _id of the mentioned document, and optionally dbname is the base data in which the document is located.

ObjectIds: { _id : {$oid: "4e942f36de3eda51d5a7436c"} }

+8
source

Source: https://habr.com/ru/post/899045/


All Articles