How to update an embedded document within an embedded document in mongoose?
问题 I am building an API in node.js which uses mongodb and mongoose. Currently I have an embedded document within an embedded document (Schema within a Schema) that is simply not persisted to the database, and I have tried all I can but no luck. I have the Schema's defined in mongoose as: var BlogPostSchema = new Schema({ creationTime: { type: Date, default: Date.now }, author: { type: ObjectId, ref: "User" }, title: { type: String }, body: { type: String }, comments: [CommentSchema] }); var