Chandrabhan SinghC
Convex Community5mo ago
4 replies
Chandrabhan Singh

Hey guys, I have this index

Hey guys, I have this index
 .index("userId", ["userId", "dueDate", "status", "isActive"]) 


bcoz, sometime I want to fetch data by "userId" with "dueDate" comparison and sometimes wanna fetch it by "userId" and "status", But Now when I'm creating the query, it's forcing me to use "dueDate" always just after the "userId" check and then only i can check "status". so, It means I'll have to create multiple indexes for this to work???? like this:

.index("userId", ["userId", "dueDate"]).index("by_user_status", ["userId", "status"]


is there any other way to do this?? I don't want to create too many indexes, as it will affect the performance obviously.
Was this page helpful?