Using Jongo API to query MongoDB, I can fetch documents from last 5 days with
Calendar cal = Calendar.getInstance();
cal.setTime(new Date());
employees.find(
"{ createdOn: { $gt: # } }",
cal.getTimeInMillis() - 5 * 24 * 60 * 60 * 1000
);
I would like to know how to query records in time interval (5 days from now, 3 days from now)
.
Assuming today is Aug 9, I need records from 4th to 6th Aug.
Thanks.