I have been using python appwrite sdk and for some reason the Query.not_equal() does not filter out the values for attribute in list.. is this a bug or error from my side?
docs = bot.appwrite_databases.list_documents(
DISCORD_DATABASE_ID,
COMMAND_USAGE_COLLECTION_ID,
queries=[
Query.is_not_null('user_id'),
Query.not_equal('user_id', ['854259184141074472', '1088367284357177404']),
]
)```
so the docs with those user_ids still show..
there is no error hence i didnt share any exception ss
also Query.equal works with that list of user ids
this
Query.not_equal('user_id', ['854259184141074472', '1088367284357177404']
means
user_id != '854259184141074472" OR user_id != '1088367284357177404'
which will always resolve to True
in practice. it doesn't make sense to pass a list to not_equal
Then why does it take an array? I would have assumed this was using not in.
Oh but with that logic Query.equal() seems weird as well since it is meant for matching any of the values in list because of OR operation but Query.not_equal() will not work with each value separately
Maybe the not_equal() should follow AND operation instead
Try to add two not_equal like so
docs = bot.appwrite_databases.list_documents(
DISCORD_DATABASE_ID,
COMMAND_USAGE_COLLECTION_ID,
queries=[
Query.is_not_null('user_id'),
Query.not_equal('user_id', ['854259184141074472']),
Query.not_equal('user_id', ['1088367284357177404']),
]
)
I can do that but for big lists that seems weird .. but yea ig i can iterate through and add the query for each value in my queries variable
Thanks for the help
Yes, I agree it can look too much just for that.
But all good since it does the job
How do you close the forum š
<a:agooglethumbsup:635256484682530825>
Click Edit here And add [SOLVED] in front of the question
Or you mean something else?
Ohh thanks
Query.not_equal() doesn't work with a list? [SOLVED]
Recommended threads
- Empty listRows() response
Hi there, I'm shehryar, I'm new to react native and appwrite as well, I'm following a tutorial, what's surprising is the listRows({databaseId, tableId, queries}...
- Skip total counts crash the query
Hello, When adding the total parameter (either true, the default, or false) to the listRows function, it raises the following error: `type 'bool' is not a sub...
- Relationships and Realtime
Since now Relationship attributes are only returned when explicitly queried, how does this change reflect in Realtime? If a listener is listening to a row from ...