Define schema in mongo realm

The bsonType of User.UserRole should be objectId - it should match the _id type of the object you’re trying to create a relationship to.

Then, you should go to the Relationships tab (right next to Schema) and create a new relationship from User.UserRole to UserRole._id.

1 Like