How to programmatically create a new subdocument from outside document? #9076
Closed
Description
For example, the only way right now that is documented to create a subdocument is:
const Model = mongoose.model('MyModel', schema);
const obj = new Model();
const subDocument = obj.someSubSchema.create(); // <--
I think it might be nice to document, if possible, a way to create the subDocument
without having to create an instance of the model?
Metadata
Assignees
Labels
No labels