0

I have data like this:

"_id" : ObjectId("5ad47a26298e81149d2fef55"),
"modified" : ISODate("2018-04-16T10:25:42.135Z"),
"type" : "disconnect",
"agent" : ObjectId("59c4b036050de1829b7331e1"),
"time" : ISODate("2018-04-16T10:25:42.134Z"),
"created" : ISODate("2018-04-16T10:25:42.134Z")

How can i use find with date. I need to retrieve data based on "time" field. How do i write query?

Thanks

Khushi
  • 1,759
  • 6
  • 26
  • 45
  • to interact with db you need serverside application, like nodejs, java, php etc – Sangram Badi Apr 16 '18 at 10:35
  • yes i am using nodejs. – Khushi Apr 16 '18 at 10:38
  • i got data like this data { date: '2018-04-16', agent: '59c4b036050de1829b7331e1' } and i tried this: collection.find({ agent: data.agent, time: { $gt: data.date } }) but if i pass date "2018-04-03" it also return the same result. exact date matching is not working – Khushi Apr 16 '18 at 10:49

0 Answers0