Auto population of virtual fields with reference to other models #13330
Unanswered
Freezystem
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I have a question regarding auto population of virtual fields.
The behavior I get is not what I expect from the auto virtual population when using
{toJSON: {virtuals: true}}
in the schema definition.Here is a test I'm expecting to pass.
I'm expecting the virtual property
author.books
to be automatically populated with the list of ids until I explicitely usepopulate("books")
to populate with expanded document.I'm wondering if I do something wrong or if I don't understand the documentation properly.
Beta Was this translation helpful? Give feedback.
All reactions