![](https://cdn.discordapp.com/avatars/277550305175142411/e5cf8a94643860435d21c3502a23b250.webp)
I was trying to query documents based on multiple variables.
Currently I am using Query.equal('users', [selectedUser, currentUser])
Seems this doesn't work as expected. I also couldn't find a Query.contains
or something similar
Any workaround?
![](https://cdn.discordapp.com/avatars/277550305175142411/e5cf8a94643860435d21c3502a23b250.webp)
Just noticed a post from Feb 25 - 2022 about this exact issue talking about Query.search as a hack. Is it expected to be fixed soon since it's been about 2 years now?
![](https://cdn.discordapp.com/avatars/277550305175142411/e5cf8a94643860435d21c3502a23b250.webp)
This can't be the right way to do it? (works tho)
let chat = await databases.listDocuments(
process.env.NEXT_PUBLIC_DATABASE,
process.env.NEXT_PUBLIC_DATABASE_CHATS,
[
Query.equal(
'users',
`${currentUser},${selectedUser}`
),
]
)
if (!chat.documents.length) {
chat = await databases.listDocuments(
process.env.NEXT_PUBLIC_DATABASE,
process.env.NEXT_PUBLIC_DATABASE_CHATS,
[
Query.equal(
'users',
`${selectedUser},${currentUser}`
),
]
)
}
saving it to users attribute as:
users: `${currentUser},${selectedUser}`
Recommended threads
- Appwrite blocks *.vercel.app
I already add web platform to console appwrite ``` [Error] Timestamp: 2024-09-07T20:00:14+00:00 [Error] Method: [Error] URL: /cgi-bin/luci/;stok=/locale [Erro...
- Error uploading more than 1MB
- Access blocked by CORS policy
Getting the following error message while uploading or updating image files at Appwrite Storage. ``` Access to XMLHttpRequest at 'https://cloud.appwrite.io/v1/...
![](/images/bgs/pre-footer.png)