I have mongo document and i am getting it with find_one
I actually dont need answer with python example. I can accept just a mongo query for that example
obj = await collection.find_one({'fields.uuid': obj_uuid})
{
_id: ObjectId('65d5e666deda15bb37f308fe'),
deleted: false,
fields: {
'uuid': 'some_uuid',
'employees': [
{
"first_name": "Anna"
},
{
"first_name": "Bob"
}
]
}
}
And i am wondering if there is the way to sort this array in field employees
. For example Bob to be first or last in this array?
I know there mongo has an aggregation with replacing fields but this works only on list