title: How to update a specific key of a specific record in MongoDB
body: <p>I'm storing some <code>Article</code> in MongoDB. By Article I mean this structure:</p>
  <pre><code>const articleSchema = new Schema({
      articleid: String,
      title: String,
      content: String,
      date: String,
      contributor: String,
      upvotes: Number,
      upvoters: [String], //&lt;--------- I NEED HELP WITH THIS
      downvotes: Number,
      downvoters: [String]
  })
  </code></pre>
  <p>I'm creating an API in NodeJS. Using this end point I want to add current upvoting user to be added in <code>upvoters</code> array in MongoDB:</p>
  <pre><code>router.post('/upvoted/:articleid/:userid', (req, res) =&gt; {
      Article.findOneAndUpdate({ articleid: req.params.articleid }, { upvoters: [&quot;req.params.userid&quot;] }, (failure, success) =&gt; {
          if (success) {
              res.status(200).send(&quot;done&quot;)
          }
          else {
              res.status(200).send(&quot;not done&quot;)
          }
      })
  })
  </code></pre>
  <p>My problem is that the array is getting replaced entirely. I want to append this user into the same <code>upvoters</code> array in MongoDB.</p>