I have mongo documents with this fields:
[
{
_id: ObjectId('662a2c03022c5f4f18566d7e'),
created_at: ISODate('2024-04-25T13:06:09.135Z'),
updated_at: ISODate('2024-04-25T13:10:11.238Z'),
fields: {
deadline: ISODate('2024-04-24T00:00:00.000Z')
}
},
{
_id: ObjectId('632a4c03017c5f4f18566d7e'),
created_at: ISODate('2024-04-25T13:06:09.135Z'),
updated_at: ISODate('2024-05-10T13:10:11.238Z'),
fields: {
deadline: ISODate('2024-05-11T00:00:00.000Z')
}
}
]
And i want to know is there the way to filter updated_at by $lte
or $gte
by fields.deadline
I was trying next aggregation but it doesnt seems to work:
{'$match': {'updated_at': {'$gte': '$fields.deadline'}}