Relationships and mongodb array in Laravel

33 views Asked by At

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

0

There are 0 answers