how do I create one-to-one edge relation?
One post has one tag and one tag has one post.
How do I create these records at the same time? Because one needs to exist before the other.
5 Replies
I believe you're looking for this: https://labs.convex.dev/convex-ents/read#traversing-11-edge
Reading Ents from the Database - Convex Ents
Relations, default values, unique fields and more for Convex
Oh you're defining, one sec
Ent Schema - Convex Ents
Relations, default values, unique fields and more for Convex
Note that 1:1's have a chicken-and-egg relationship in Convex, you have to create one before you can create the other, hence the
{ optional: true }
in the example linked above.oh thanks it works
optional is the way