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
Populate on a ref field that has an empty string returns a random document from that collection.
Possible solution
Looking at the source, the populate() is the return of a findOne(). findOne() will return the first value when no arguments are supplied. I would suggest to check for falsy on the value of the path argument of the populate function and to return null if false.
First thanks for this great repo!
Case
Bug
Issue
Populate on a ref field that has an empty string returns a random document from that collection.
Possible solution
Looking at the source, the populate() is the return of a findOne(). findOne() will return the first value when no arguments are supplied. I would suggest to check for falsy on the value of the path argument of the populate function and to return null if false.
Info
Code
Example:
Suggested fix:
The text was updated successfully, but these errors were encountered: