findOneAndUpdate with condition
<p>I am trying to update a record based on condition:</p>

<pre><code>Product.findOneAndUpdate({
        number: fields.number[0]
    }, {
        category: fields.category[0],
        name: fields.name[0]
    },
    function(err, product) {


    });
</code></pre>

<p>So, I want to check if fields.category is present then update else do not update the original value.</p>

<pre><code>fields.category ? fields.category[0] : ""
</code></pre>

<p>What is the proper way to do it?</p>