Это моя схема:
const senderSchema = mongoose.Schema({
group: [{
groupName: {
type: String
},
groupId: {
type: String
},
createdAt: {
type: Date,
default: Date.now
},
message: [{
message: {
type: String
},
senderId: {
type: String
},
sendFrom: {
type: String
},
sendAt: {
type: Date,
default: moment.utc().valueOf()
}
}]
}]
})