Answer the question
In order to leave comments, you need to log in
Why are documents not being embedded in Mongo?
Good afternoon. Went into a dead end. Google didn't help.
There are 2 models in mongoose - Project, Payment. One-to-many relationship. There are many Payments in one Project.
Here is the Payment model, which has a reference to the creator - the Project model.
I want to get all Projects with Pyments embedded in them via populate();
But instead comes an empty array.
When creating a Payment, I save them like this with a link to the Project
What am I doing wrong?
By the way, if you put _ before payments in the Project model, then not an empty payments array is returned, but with payments id's.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question