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()メソッドを使用しても、これを試してみました。
私はここで間違っていますか?
ありがとうございました! [0] .byDateは私の検索のコールバックで一日保存されたデータにdata.byDateを変更
: