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
- 403 The current user has been blocked.
Hello, I have a free plan; I've tried to access my project and I get the message "403 The current user has been blocked." I have database, sites, and auth in us...
- [Bug?] row_already_exists (409) after ma...
Hi, I'm experiencing a confusing issue with Appwrite Cloud Setup: A `tournaments` table with a composite UNIQUE index on (tournament_name, date). Steps to rep...
- appwrite pull Tables duplicates all coll...
I encountered a bug when running appwrite pull Tables. Every existing collection in my appwrite.json gets duplicated. One collection ended up appearing three t...