MongoDB Aggregation : How to compare among array of objects in same document
Below is my document. I want to compare the objects in array SKUPromo and get only those objects which have overlapping dates. { "_id": "2531090", "SKUPromo": [ { "_id": "1", "startDateTime": { "$date": "2023-01-05T06:00:00.000Z" }, "endDateTime": { "$date": "2023-02-07T05:59:59.000Z" },…