1
我有以下模式配置:節約嵌套的貓鼬對象數組
childSchema = mongoose.Schema({
filePath: String,
color: String
})
parentSchema = mongoose.Schema({
date: String,
files: [childSchema]
})
grandparentSchema = mongoose.Schema({
name: String,
byDate: [parentSchema]
})
保存parentSchema的更新錄入工作正常使用
model.markModified('byDate')
model.save()
,但它不與childSchema工作。
我也嘗試過使用MongooseArray.set()方法,但沒有成功。
我在這裏做錯了什麼?
謝謝!