saving nested mongoose object arrays
<p>I have the following schema config:</p>

<pre><code>childSchema = mongoose.Schema({
    filePath: String,
    color: String
})
parentSchema = mongoose.Schema({
    date: String,
    files: [childSchema]
})
grandparentSchema = mongoose.Schema({
    name: String,
    byDate: [parentSchema]
})
</code></pre>

<p>Saving an updated entry of parentSchema works fine using</p>

<pre><code>model.markModified('byDate')
model.save()
</code></pre>

<p>but it does not work with the childSchema.</p>

<p>I have also tried it with the MongooseArray.set() method, without success.</p>

<p>What am I doing wrong here?</p>

<p>Thank you!</p>