-
Notifications
You must be signed in to change notification settings - Fork 1.5k
-
I have a collection:
{
...
users: ["..some objectID", "another objectID"]
...
}
Can I use relationships to get information about these users from the User model or do I need to make a separate query?
I understand that I can extract the ID and make a separate query using whereIn, but this will be very inefficient especially with pagination when a large amount of data is retrieved
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment 1 reply
-
This is how relationships are implemented. The string
representation of ObjectId
is used for compatibility with Eloquent. You should look at Relationships.
Beta Was this translation helpful? Give feedback.
All reactions
1 reply
-
In my question I wrote that I want to use relationships, but I don’t know what kind and how
Beta Was this translation helpful? Give feedback.
All reactions
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment