TypeScript
user_id = data["user_id"]
followed_id = data["followed_id"]
result=None
query=[Query.equal("follower",user_id),Query.equal("following",followed_id)]
try:
result=databases.list_documents(databaseID,followCollectionID,queries=query)
print(result)
except Exception as e:
print(e)
result=None```
when i search one by one query it comes but i actually want to search if the collection has a document which satisfies both the queries how can i do that ?
if i use this syntax i get an index error
TL;DR
TL;DR: User is having trouble creating a query in a Python SDK that searches for a document that satisfies multiple conditions. They currently have a workaround using two separate requests, but are looking for a solution to check if a document exists that satisfies both conditions in a single query. They have provided code for reference. An index error is encountered when trying to implement the solution. No solution is provided in the support thread.What do you mean? You want this?
TypeScript
follower == user id AND following == followed id
Yess i want to see if that exists in the same document
I got a workaround using 2 requests and checking if id matches
It should work...whats the result of the API call?
An error index does not exist
But when called individually it comes
So...did you create 1 index with both the attributes?
No 2 🤔 we had to create one idex with both?
In it
Yep!
Let me try that asal
Asap *
Recommended threads
- Auth not working on expo react native
I'm trying to launch a development server with expo go and appwrite as a backend. On my windows pc, I've got a local docker instance of appwrite running as my b...
- Urgent help required - Could not resolve...
I upgraded my production environment to 1.8.0 but experienced issues with appwrite running out of worker threads. I downgraded back to 1.6.1 and restored the da...
- How to change "collection Id" to "collec...