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?
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?
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
- Any way to temporarily bypass the email ...
Hey guys, any way to bypass the email verification to use the accounts again? i need to recover some projects that due to recent changes have been stopped, and ...
- Collections list not showing up when try...
I'm trying to create new relationship attribute but both one way and two way relationship is not showing up collections list to connect with my relationship att...
- I have try to use the appwrite in to the...
Invalid Origin. Register your new client (oailedjdbkhlkakmnnapoonllbnfmfij) as a new Web (Chrome Extension) platform on your project console dashboard