I am having a teams collection which stores members details.
teamA is having member A11 which is de-active, that means this member A11 can be part of another team but the activationDateTime should be after the deactivationDateTime from teamA value. Team A - member A11 is having deactivation date time- “deactivationDateTime”: “2023-01-06 08:00:00.000Z”
Team B is having member A11 but this member is having “activationDateTime”: “2023-01-05 08:00:00.000Z”,
which is overlapping with the same member in another team. same date overlap happens with members B11 in teamC.
we need to find out such members whose dates are overlapping (dates should be exclusive).
[
{
"teamName": "teamA",
"members": [
{
"memberId": "A11",
"activationDateTime": "2023-01-05 08:00:00.000Z",
"deactivationDateTime": "2023-01-06 08:00:00.000Z"
},
{
"memberId": "A12",
"activationDateTime": "2023-01-05 08:00:00.000Z",
"deactivationDateTime": "2023-01-06 08:00:00.000Z"
},
]
},
{
"teamName": "teamB",
"members": [
{
"memberId": "A11",
"activationDateTime": "2023-01-05 08:00:00.000Z",
},
{
"memberId": "B11",
"activationDateTime": "2023-01-05 08:00:00.000Z",
"deactivationDateTime": "2023-01-06 08:00:00.000Z"
},
{
"memberId": "B12",
"activationDateTime": "2023-01-10 08:00:00.000Z",
},
]
},
{
"teamName": "teamC",
"members": [
{
"memberId": "C11",
"activationDateTime": "2023-01-05 08:00:00.000Z",
},
{
"memberId": "B11",
"activationDateTime": "2023-01-04 08:00:00.000Z",
},
]
},
]