Mongoose findOneAndUpdate with multiple field update operators
<p>I'd to set a min value, max value and increment a count within a document with a single update but can't find the correct syntax</p>

<p>This works for incrementing the counts in the document:</p>

<pre><code>Temperature.findOneAndUpdate(dailyQuery,
    { $inc: { temperature_sum : thermometer.temperature, count : 1 }},
    {upsert : true}, function(err, dailyTemp) {
    if (err) throw err;
    console.error(dailyTemp);
});
</code></pre>

<p>I'd like to also set min max values also and thought the update command would be along the lines of</p>

<pre><code>Temperature.findOneAndUpdate(dailyQuery,
    { $inc: { temperature_sum : thermometer.temperature, count : 1 },
        $max :{ max_temp : thermometer.temperature},
        $min :{ min_temp : thermometer.temperature}},
    {upsert : true}, function(err, dailyTemp) {
    if (err) throw err;
    console.error(dailyTemp);
});
</code></pre>

<p>But I get </p>

<pre><code>MongoError: exception: Invalid modifier specified $min
</code></pre>

<p>What am I missing here?</p>