You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to understand how to set the a many to one relation. As I understand it for 1 to 1 relations the following would be await database.get('comments').create(comment => { comment.author.set(someUser) // ... }) .
If I was to want to add many would users, say if this relation was hypothetically many to one, with comments allowing for many users, would it simply be await database.get('comments').create(comment => { comment.author.set(someUser) comment.author.set(someUser2) comment.author.set(someUser3) })
Thanks.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am trying to understand how to set the a many to one relation. As I understand it for 1 to 1 relations the following would be
await database.get('comments').create(comment => { comment.author.set(someUser) // ... }) .
If I was to want to add many would users, say if this relation was hypothetically many to one, with comments allowing for many users, would it simply be
await database.get('comments').create(comment => { comment.author.set(someUser) comment.author.set(someUser2) comment.author.set(someUser3) })
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions