Hey Convex team,
I want to post a bug during the querying of documents using indexes
The stars table contains all the information about a snippet (which is used in my project) and tells whether that code snippet is starred by a user or not
Let's say a user "X" has starred a snippet "Y"
Now, whenever I try to query the stars table for a user "Z", the result is ambigous and it shows that user "Z" has already starred the snippet "Y" which is not true in this case
Kindly look into the problem or If I am doing something wrong, then kindly clarify and correct me


2 Replies
You've accidentally used both an index with a filter function for the indexed fields - the query builder should go inside the
.withIndex
call. It's an easy mistake to make, take a look at this section of the docs which explains the differences.
https://docs.convex.dev/understanding/best-practices#avoid-filter-on-database-queriesBest Practices | Convex Developer Hub
This is a list of best practices and common anti-patterns around using Convex.
Ohk, I got it
Thanks for resolving the issue !!🫡