-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
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
.slice() before .populate() causes data loss (with test) #5737
Comments
Thanks for the detailed repro instructions, will investigate ASAP 👍 |
Thanks for the quick fix! 🍻 |
This bug still reproduce when populating one of schema fields. Reproduce
What is the expected behaviour? Please mention your node.js, mongoose and MongoDB version. This test passed in mongoose 4.11.13, and since version 4.11.14 stopped working |
What is the current behavior?
If .slice() is called before .populate() then data of the original object is lost.
Reproduce
Add this test to
test/model.populate.test.js
and run mocha. I took the test "populating an array of refs and fetching many" and added the lineassert.equal(blogposts[0].title, 'Woot');
What is the expected behavior?
The above test should pass.
Please mention your node.js, mongoose and MongoDB version.
node 8.3.0
mongod 3.2.11
mongoose 4.12.4
The text was updated successfully, but these errors were encountered: