I’m evaluating an Atlas serverless setup, but unfortunately, it doesn’t support collation (has it been stated whether adding support is on the roadmap?).
I’ve got an array of subdocuments. If a user edits one of the subdocuments’ name
field, I want it to be re-sorted. I’m using the following routine to do so:
await self._async_collection.update_one(
self.find_query,
{
"$push": {
"macros": {
"$each": [],
"$sort": {"name": 1},
}
}
},
collation={"locale": "en"},
)
I know that I could sort the array in application code and use $set
to replace the entire array, but before I resort to that, I want to know if there is another method I should try first. I’m using collation because I need a case-insensitive sort.