Not able to update multiple record with reference to sub object _id in mongodb nodeJS
<p>I want to update other table value with change on master table.
My model is:</p>

<pre><code>var model = new Schema({
   client:{
      _id: Object,
      companyName: String,
   },
   branchName: String,
});
</code></pre>

<p>My node js code is:</p>

<pre><code>var objBranch = require('../models/branchMSTModel');
objBranch.findOneAndUpdate({ "client._id": doc._id }, { $set: { "client.companyName": doc.companyName } }, function (err, result) {
        console.log(result);
        console.log(err);
    });
</code></pre>

<p>In this "doc" is object with all value.
i want to update company name where "_id" match with "doc._id".</p>