greysonG
Convex Community3y ago
1 reply
greyson

Question on one to many relationship in database

I'm trying to create a database table where an item can have many user's attached to it, but i'm not sure the best way to do this with convex. Is there a way to index on an array of user ids?

It doesnt feel scalable to search all items and filter by if an id is in the array. Is there a better way to handle this relationship and make a more scalable secondary key for querying on?


items: defineTable({
people: v.array(v.id("users")),
itemName: v.string(),
})
Was this page helpful?