greyson
CCConvex Community
•Created by greyson on 10/8/2023 in #support-community
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(),
})
2 replies