We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have a model like this:
class City(JsonModel): country_id: str = Field(index=True) region_id: str | None = Field(index=True)
How do I query for a city in a specific country that is not associated with any region? I.e.: a capital or a large city like Bremen in Germany?
The following queries do not work and raise errors:
cities = City.find((City.country_id == "de") & (City.region_id is None)).all() aioredis_om.model.model.QuerySyntaxError: Counld not resolve field name. See docs: TODO
cities = City.find((City.country_id == "de") & (City.region_id == None)).all() TypeError: argument of type 'NoneType' is not iterable
I failed to find any reference in the docs about scenarios like that... 🤔
P.S.: SQLAlchemy has .filter(City.region_id == None) or .filter(City.region_id.is_not(None)) to handle those cases.
.filter(City.region_id == None)
.filter(City.region_id.is_not(None))
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I have a model like this:
How do I query for a city in a specific country that is not associated with any region? I.e.: a capital or a large city like Bremen in Germany?
The following queries do not work and raise errors:
I failed to find any reference in the docs about scenarios like that... 🤔
P.S.: SQLAlchemy has
.filter(City.region_id == None)
or.filter(City.region_id.is_not(None))
to handle those cases.The text was updated successfully, but these errors were encountered: