Compare Strings and ObjectIds in JSON Expressions
We have a use-case where we need to compare an ObjectId on a document to the ObjectId of the user's custom data doc. However, because the ID of the user's custom data object is returned as a string and not as an ObjectId, there is no way to make this comparison without creating a function just to compare the ObjectId and the string. The overhead of invoking a function just to call toString on the ObjectId is going to be a major problem, especially because we need to make this comparison 5 times for every single operation on our most heavily trafficked collection.
This could be easily solved by what should be a rather simple feature to add, an operator that could be used to compare an ObjectId to a string within JSON expressions.
I think the best justification for this addition is that there are several situations where you simply cannot get an ID in ObjectId form as it is only provided as a string, like the ID on user custom data docs.