0
나는 자바 스크립트 쉘을 통해 챔피언처럼 작동하는 쿼리 ...Mongo Java Driver에서 "Date Between"쿼리를 작성하는 방법은 무엇입니까?
db.profiles.find(
{ "createdOn" :
{ $gte : ISODate('2013-04-01T00:00:00.000Z'),
$lt : ISODate('2013-04-02T00:00:00.000Z')
}
}
)
있습니다. Java 드라이버를 통해이 작업을 수행하려면 어떻게해야합니까?
DBObject condition = new BasicDBObject(2);
condition.put("$gte", startDate);
condition.put("$lt", endDate);
Iterable<DBObject> result = collection.find(new BasicDBObject("createdOn", condition));
내가하지 않은 그 유망 같습니다 –