我的mongo文件如下
{{
"startTime" : "2012-12-06T18:30:00.000Z",
"endTime" : "2012-12-07T18:30:00.000Z",
"cost" : "40",
"_id" : ObjectId("50c31b65d2dfa2271b000001")
}
{
"startTime" : "2012-12-07T18:30:00.000Z",
"endTime" : "2012-12-08T18:30:00.000Z",
"cost" : "40",
"_id" : ObjectId("50c31b65d2dfa2271b000001")
}
{
"startTime" : "2012-12-05T18:30:00.000Z",
"endTime" : "2012-12-07T18:30:00.000Z",
"cost" : "40",
"_id" : ObjectId("50c31b65d2dfa2271b000001")
}
}
我曾尝试根据日期范围查询mongo文档,我的查询如下:
db.collection.find({"startTime":{"$gte":"2012-12-05T18:30:00.000Z"},"endTime": {"$lt":"2012-12-12T18:30:00.000Z"}});
响应为空...