Answer the question
In order to leave comments, you need to log in
Is such a "$lookup" possible in MongoDB?
I have a student document and it has a notes field.
I want to separate these notes into a separate collection, but I don't want to copy the id of this note into this array to the student.
I would like these notes to have, for example, an owner_id, and this array would contain only those notes whose owner_id matches the student's id.
Is it possible to do this without aggregation (I use mongoose), and in principle, is it at least possible with it?
Answer the question
In order to leave comments, you need to log in
You can at least make a second request to the collection with notes, find an array of student records, and insert them into the answer manually
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question