I use spring data mongodb.
I want the records between two dates. The following MongoDB Query works:
db.posts.find({startDate: {$gte: start, $lt: end}
It works, he is some sample code:
Criteria criteria = Criteria.where("pt").gte(startDate) .andOperator(Criteria.where("pt").lt(endDate));