Hi there, I have the following document
{ _id: ‘ID_1’,
INFO_1: 123,
INFO_2: 456,
NESTED_OBJ:
{ ‘1648609200’:
{ TIMESTAMP: 1648609200,
INFO3: 7,
INFO4: 8},
‘1648612800’:
{ TIMESTAMP: 1648609200,
INFO3: 10,
INFO4: 11},
‘1648645200’:
{ TIMESTAMP: 1648645200,
INFO3: 12,
INFO4: 13}
}
update_at: 2022-03-30T23:00:51.662Z }
I need to delete only the nested documents with TIMESTAMP < 1648645200, please noticed that the ID of the nested docs are the same as the TIMESTAMP. So in this example the final doc would be:
{ _id: ‘ID_1’,
INFO_1: 123,
INFO_2: 456,
NESTED_OBJ:
{‘1648645200’:
{ TIMESTAMP: 1648645200,
INFO3: 12,
INFO4: 13}
}
update_at: 2022-03-30T23:00:51.662Z }
Thanks in advance guys!