Mongoose / MongoDB - Simple example of appending to a document object array, with a pre-defined schema
问题 For the sakes of simplicity, assuming these are my collection schemas: var MessageDeliverySchema = new Schema({ from : { type : String }, to : { type : String }, status : { type : String } }); var Messages = mongoose.model('messages', new Schema({ id : ObjectId, user : { type:String }, 'sent-messages' : [MessageDeliverySchema] })); So each document in the collection Messages may have 4/5 sent-messages defined by the MessageDeliverySchema. What I want to do is have an array of sent-messages ,