Closed as not planned
Description
I ran into issue with Azure Cosmos DB with latest ver 8 during deployment.
My solution a quick fix via monkey patch of query_utils.py
def regex_match(field, regex_vals, insensitive=False):
"""
Safe override for MongoDB $regexMatch to ensure input is a string.
"""
regex = {"$concat": regex_vals} if isinstance(regex_vals, tuple) else regex_vals
options = "i" if insensitive else ""
return {
"$regexMatch": {
"input": {
"$cond": [
{"$eq": [{"$type": field}, "string"]},
field,
{"$toString": field}
]
},
"regex": regex,
"options": options
}
}
Metadata
Metadata
Assignees
Labels
No labels