naveenOriginal post
Rank 1: Thread
api.provider().database.listDocuments(databaseId,collectionId,
[Query.equal('lesson',id)],[Query.equal('subject',cat)], );
I used this syntax but it is taking only the first condition and ignoring the second;
I have kept an key index containing two attributes lesson and subject but the above syntax throw an error as index not found , so i added subject and lesson as separate index but now it is taking only the first query.
Summary
It seems that the provided syntax is not working as expected. To query key indexes with multiple attributes, both queries should be inside an array. For example:
```
api.provider().database.listDocuments(databaseId, collectionId, [
Query.equal('lesson', id),
Query.equal('subject', cat)
]);
```
However, it appears that the syntax provided in the question is only taking the first query into account and ignoring the second one. Additionally, the error "index not found" occurred when attempting to use a single index with both attributes. To resolve this, you should create separate key indexes for both 'lesson' and '