model relationships, are there benefits to using v.id?
I have a simple schema
I'm curious if there is a performance benefit to instead have the userId on plan be v.id("plans") or if this approach will basically work the same (assuming I add an index)?
2 Replies
the reason I'm doing this, is because on my clerk session, I only have access to the clerk's userId which makes it a lot easier to just filter by userId on plans instead of having to first look up the user, get the _id, then query by plans
There are no advantages here besides that the index on
_id
is already there and can't be disabled. Creating your own identifier like this absolutely makes sense as long as you use an index.