Mongoose Model.update with dynamic field name
<p>I'mtrying to pass field name as variable , here is what I tried but it's not working :</p>

<pre><code>var update={};
update[req.body.field]=req.body.value;
Model.update(
    {"email":req.user.email},
    {$set:{update}},
    function (err,success) {
        if(err) return handleError(err);
    }
)
</code></pre>

<p>req.body.field contains the name of the field defined in the Model schema and req.body.value is the value I want to update with</p>