Closed hacking2 closed 8 years ago
Does inside MongoDB stored correctly as ISODate? Notice that from the point of view of NoSQLUnit we are using the MongoDB util class DBObject parsedData = (DBObject) JSON.parse(jsonData)
so probably the data is correctly inserted into MongoDB, the problem you might find probably is related with mapper library used.
the following works for me (using java.util.Date instead of DateTime)
{ "people" : { "data" : [ { "key" : "12345", "phone" : "33333", "register" : { "$date": "2011-01-05T10:09:15.210Z" }, "index" : 1 } ] } }
I can confirm the { "$date" : "..."} notation also works Joda DateTime objects.
It is actually the representation of _datadate objects the MongoDB Extended JSON strict mode.
Representation of datetime and other BSON data types (object ids, db refs...) in JSON strict mode is given on the MongoDB reference manual.
In addition, it is important to note that the ISO 8601 UTC notation "1994-11-05T13:15:30Z" must be used. Dates formatted with localtime and timeoffset "1994-11-05T08:15:30-05:00" are parsed incorrectly.
Hi, I am using nosql-unit-mongodb, fongo, and have some problem.
when using @ShouldMatchDataSet or @UsingDataSet, I wrote like below
//expected.json
my domain object like this
when I load data, register always null. How can I write ISODate format in expected file?
Thanks for your help