Given the many-to-many relation example given in the docs with User and Car in a many-to-many relationship, how does one associate an existing user to an existing car using FQL? Can Connect be used? Does the related index have to be updated directly (e.g. user_cars_by_user, user_cars_by_user_and_car, user_cars_by_car)? Can someone give an example of associating an existing User to an existing Car using FQL for the schema below? Thanks for any help!
type User {
name: String!
drives: [Car!] @relation
}
type Car {
plate: String!
drivers: [User!] @relation
}
@ThoughtPoet I don’t see a reason why Connect
cannot be used to associate an existing User to an existing Car. Are you still looking for an example? If so, I could probably write one.
Hi Jay,
An example would be wonderful! I have tried using connect, but though that seems to work, the index, car_drivers, never gets updated. It seems like an anti-pattern to create a bunch of mapping collections manually, though had I simply done that, I wouldn’t have wasted so much time trying to figure out how to do this… In my real data model, I’d have to manually create and maintain 10s of such mapping collections.
Fred