Replies: 1 comment
-
|
Let's say your model name is regex = re.compile(f"^{name}$", re.IGNORECASE)
query = Foo.name.match(regex)
results = await engine.find(Foo, query)The idea is to compile a case-insensitive regular expression in Python first, and then pass this pre-compiled expression to the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, im changing my project from working with pymongo to odmantic and i cant find how can i execute this query
db.find_one({"name": {"$regex": f"^{name}$", "$options": "i"}})
I execute this query in a function where i get the parameter "name" and i want to check if it exists in my db but i want to check it case-insensitively.
Beta Was this translation helpful? Give feedback.
All reactions