We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not a big deal, Lil' improvement.
After defining my model and adding a populable virtual prop.
MyModel.virtual( "myVirtual" { ref: "MyOtherModel" localField: "_id", foreignField: "theFieldIWant, justOne: false, match: { type: 'thisType' }, options: { limit: 2 }, } );
The following will work as expected.
const gameAccountStats = await MyModel.findById(documentId) .populate("myVirtual")
If I need to tweak the populate options such as:
MyModel .findById(myDocumentId) .populate({ path: "myVirtual", match: { createdAt: { $gte: startDate, $lte: endDate } }, options: { limit: 1, } });
Won't work as expected, meaning it will return null.
But if I re-define the model within the options it gets back to business again
MyModel .findById(myDocumentId) .populate({ model: "MyOtherModel", path: "myVirtual", match: { createdAt: { $gte: startDate, $lte: endDate } }, options: { limit: 1, } });
Happy holidays
The text was updated successfully, but these errors were encountered:
Misuse on my end.
Sorry, something went wrong.
No branches or pull requests
Not a big deal, Lil' improvement.
After defining my model and adding a populable virtual prop.
The following will work as expected.
If I need to tweak the populate options such as:
Won't work as expected, meaning it will return null.
But if I re-define the model within the options it gets back to business again
Happy holidays
The text was updated successfully, but these errors were encountered: