Questions tagged «isodate»

10
在mongodb中使用ISODate进行日期查询似乎不起作用
我似乎甚至无法获得最基本的日期查询来在MongoDB中工作。使用看起来像这样的文档: { "_id" : "foobar/201310", "ap" : "foobar", "dt" : ISODate("2013-10-01T00:00:00.000Z"), "tl" : 375439 } 和一个查询,看起来像这样: { "dt" : { "$gte" : { "$date" : "2013-10-01T00:00:00.000Z" } } } 我从执行中得到0个结果: db.mycollection.find({ "dt" : { "$gte" : { "$date" : "2013-10-01T00:00:00.000Z"}} }) 知道为什么这行不通吗? 作为参考,此查询由Spring的MongoTemplate生成,因此我无法直接控制最终发送给MongoDB的查询。 (PS) > db.version() 2.4.7 谢谢!
189 json  mongodb  bson  isodate 

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.