We are using mongo db to store certain records in production database.
We see our records having "_id" : { "$oid" : "50585fbcb046b2709a534502"}
in production database , while we see same record as "_id" : ObjectId(" 50585fbcb046b2709a534502 ")
in the qa database.
For dates we see "ld" : { "$date" : "2011-12-03T17:00:00Z"}
in prod database, while "ld" :ISODate("2011-12-03T17:00:00Z")
in qa database.
We have tested our queries successfully in qa environment, but worried it might fail in production
1) Will my java queries work seamlessly on prod & qa both? (I am using morphia apis to query) 2) Are they internally being stored in the same identical way?
To answer the two questions:
ObjectId
and ISODate
(normally) whereas picking it out directly from the server language (Java in your case) will tend to show the full objects properties ($oid
and $date
in this case).