Mongoose populate multiple levels
Published in
1 min readFeb 27, 2019
I have the following structure and I need to populate the reference in multiple level in mongoose.
Both message and from is reference from other modal, so I will need to populate message first, then populate the from inside the replies array.
{
message: {
replies: [{
from:
}]
}
})
Here are what work and what not work for me.