0

I want to get only that data between start date and end date.

For.ex I have passed the date: 2020-10-08 12:15:10

Table
-------
Id    Startdate                      EndDate
1     2020-10-10 12:15:10            2020-10-15 12:15:10
2     2020-08-12 12:15:10            2020-08-15 12:15:10

using a MySQL query:

select * from table where '2020-10-08 12:15:10' between startDate and endDate

it's working but I need it in MongoDB so how can do it.

Please help me.

  • https://stackoverflow.com/questions/2943222/find-objects-between-two-dates-mongodb – Piotr Stefański Aug 31 '20 at 13:48
  • 1
    Look this Question, i think it is what you need: https://stackoverflow.com/questions/2943222/find-objects-between-two-dates-mongodb – Piotr Stefański Aug 31 '20 at 13:50
  • Thanks, but I don't need this type of data. I want to check my date is inside in the start date to end date that's data only give me. please check first my example in DB with given than you understand. – Hardik Patel Sep 02 '20 at 04:19

0 Answers0