i am trying to split date in mongodb. For Example ,start date is 2020-07-01 & end date is 2020-07-05 , then , all date should be split in a sequence (i.e:- 2020-07-01,2020-07-02,2020-07-03,2020-07-04,2020-07-05) ?can anyone help me ?
Asked
Active
Viewed 60 times
2 Answers
0
in js, you could
var start = new Date("2020-03-05");
var stop = new Date("2020-03-09");
for (d=start; d<=stop; d.setDate(d.getDate() + 1)) {
console.log(d)
}

mankowitz
- 1,864
- 1
- 14
- 32
-
1Great - if this was useful, mark the answer as correct for other users – mankowitz Jul 07 '20 at 11:04