
Hi,
I have a document which have a key named "vendor_id" which is by default, null. Then it can be changed to specific User Id. What I'm trying to do is to get all documents which is either null and have a specific user id.
Use case, to get all documents which still doesnt have any vendor_id and also those that have his user id as the key in vendor_id.
My question is how to query a null value in a key, I tried something like
Query.equal("vendor_id", [``, ${user?.$id}
]),
and it doesnt work. Thanks in advance.

Use the isNull
query: https://appwrite.io/docs/products/databases/queries

Hi Steven, if I use
Query.isNull("vendor_id"), it will only get the document if only the key null, so if I also want to get get documents that also have vendor_id as my user.$id, I would have to create another function that's something like Query.equal("vendor_id", [user.$id]) that will pull another batch of documents instead.
What I was hoping to achieve is to use something like Query.equal("vendor_id", [NULL, user.&id]) or Query.between("vendor_id", NULL, user.$id) (If I read the Query.between purpose correctly) that will pull both documents that have NULL vendor_id and my user.$id.

Oh sorry, I misread...you're trying to do an OR query which isn't supported yet.

ah ok

Thanks for the clarification

Is it something that being considered to be implemented?

[Solved] Query for null value

Yes, see https://github.com/appwrite/appwrite/discussions/7197
Also, please make sure to 👍 this issue: https://github.com/appwrite/appwrite/issues/2740 and
Recommended threads
- Subdomain failed verification
So I wanted to do a custom subdomain, because local storage doesn't work for me, but I've tried it a long time ago, it didn't work for me, and now I'm trying ag...
- Query params are way too limiting in ter...
I was trying to list rows in a table that do not already exist in another table. I retrieved around 260 row IDs which are 13 characters in length each, and then...
- [Node.js SDK] Bypass 2GB file limit?
Hello. Using either InputFile.fromPath or InputFile.fromBuffer throws this error: File size (2295467305) is greater than 2 GiB Bucket limit etc. is setup corre...
