aromatt
aromatt•2w ago

Hi all,

Hi all, QQ - if i have a many to many relationship, does convex have any native mechanism to avoid duplication when inserting? Or do I simply need to check that inside my mutation for the assoc tables?
3 Replies
erquhart
erquhart•2w ago
Typescript is the native mechanism 😛 But srsly yeah, just check in the mutation. You can also use .unique() when querying - that doesn't enforce unique writes but at least throws errors on read.
aromatt
aromattOP•2w ago
yeah not a biggie, just wondered 🙂 its a simple check after all 🙂 but rather not do my own logic if there would be an OOB one avail
erquhart
erquhart•2w ago
Yeah I understand that. Everyone checks for one lol. (I definitely did)

Did you find this page helpful?