I am using com.mongodb.util.JSON.parse to parse a JSON file to DBObject. How do I specify dates, refs, and objects IDs in the JSON file?
I am using com.mongodb.util.JSON.parse to parse a JSON file to DBObject. How do I
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Dates :
{ myDate: {$date: "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'" } }// Date in the mentioned ISODate string format.Refs :
{ myRef : { $ref : <collname>, $id : <idvalue>[, $db : <dbname>] } }// collname is collection name, idvalue is the _id of the referred document and optionally dbname is the database the document is in.ObjectIds :
{ _id : {$oid: "4e942f36de3eda51d5a7436c"} }