Skip to content

Populate Nested refernces #30

@pehaada

Description

@pehaada

I was digging in the code and it appears that the ?populate feature will only work on top level documents. For example I have a Collection that contains 2 levels of nesting I'm not sure if I'm missing the way to populate nested values.

My Schema looks like the following

var CaseSchema = new Schema({
Plaintiff: {type: String },
Recipients: [RecipientSchema]
});

var RecipientSchema = new Schema({
service:{ type: ObjectId, ref: 'service' } ,
assignedId: {type: ObjectId},
Documents: [DocumentSchema],
});

I assume that out of the box I can't have MERS populate my service reference. I get the ID back but I have no way to specify the population of "nested" documents within Mongoose.

Thanks !
Adam

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions