Sample Docs :
{
"_id" : ObjectId("5e7331614dd99d1a30143a58"),
"status" : "rejected",
"from" : ISODate("2020-03-17T08:46:02.552Z"),
"to" : ISODate("2020-03-18T08:46:07.124Z")
},
{
"_id" : ObjectId("5e7331614dd99d1a30143a58"),
"status" : "rejected",
"from" : ISODate("2020-03-02T08:08:32.819Z"),
"to" : ISODate("2020-03-05T08:08:37.125Z"),
}
I am new to mongodb, I want to count the number of days between dates (to and from fields) of each document where status is equal to 'rejected'