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
- Update User Error
```ts const { users, databases } = await createAdminClient(); const session = await getLoggedInUser(); const user = await users.get(session.$id); if (!use...
- apple exchange code to token
hello guys, im new here 🙂 I have created a project and enabled apple oauth, filled all data (client id, key id, p8 file itself etc). I generate oauth code form...
- How to Avoid Double Requests in function...
I'm currently using Appwrite's `functions.createExecution` in my project. I want to avoid double requests when multiple actions (like searching or pagination) a...