title: How to update MongoDB document based on its previous values?
body: <p>Sorry if this is pretty basic, but I'm a mongodb newbie and haven't been able to find an answer to this:</p>
  
  <p>Let's say I'm doing the following:</p>
  
  <pre><code>db.collection("bugs").updateOne({ _id: searchId }, { $set: { "fixed": true }}
  </code></pre>
  
  <p>How to set "fixed" to the contrary of whatever the last value of "fixed" was? Without any additional queries? Something like <code>{ $set: { "fixed": !fixed }}</code></p>