title: Mongo $push is adding 2 array elements when it should only being adding 1
body: <p>I am using Mongo v4.4.3 and Node.js</p>
  <p>I have a Mongo document like:</p>
  <pre><code>{
      &quot;_id&quot;: &quot;6060f7a3ff557c7a21b99d1f&quot;,
      &quot;user&quot;: &quot;3b0939b6-93e9-4ba8-b183-82819cf99999&quot;,
      &quot;name&quot;: &quot;Max Headroom&quot;,
      &quot;gender&quot;: &quot;M&quot;,
      &quot;age&quot;: &quot;28&quot;,
      &quot;country&quot;: &quot;Cameroon&quot;,
      &quot;region&quot;: &quot;Adamaoua&quot;,
      &quot;questions&quot;: [
          {
              &quot;_id&quot;: &quot;6060f7a3ff557c7a21b99d20&quot;,
              &quot;topics&quot;: [
                  {
                      &quot;_id&quot;: &quot;6060f7a3ff557c7a21b99d21&quot;,
                      &quot;topic&quot;: &quot;Malaria&quot;
                  }
              ],
              &quot;keepPrivate&quot;: false,
              &quot;validQuestion&quot;: true,
              &quot;question&quot;: &quot;1st test question to see if it will be added&quot;,
              &quot;askedAt&quot;: &quot;2021-03-08T22:15:10.123Z&quot;
          }
      ],
      &quot;__v&quot;: 0
  }
  </code></pre>
  <p>I have node.js code to update the name/age and add a new question using:</p>
  <pre><code>async function updateExistingUserAndAddQuestion(userQuestion, res){
      // The user under the uuid exists so update all the user fields and add the
      // question to the questions array
       newQuestion = userQuestion.questions[0]
       await Users.updateOne({&quot;user&quot; : userQuestion.user}
            ,{$set : {name : userQuestion.name
            ,age : userQuestion.age
            ,$push: {questions: {$each:[newQuestion], $position: -0 }}
            }
            , function(err , results){
                     if (err) {
                         errorResult(err,res)
                     } else {
                         return res.status(200).send(results)
                     }
              }
       );
  }
  </code></pre>
  <p>But when I update the existing document, changing the age and adding a new question:</p>
  <pre><code>{
        &quot;user&quot;: &quot;3b0939b6-93e9-4ba8-b183-82819cf99999&quot;,
        &quot;name&quot;: &quot;Max Headroom&quot;,
        &quot;age&quot;: &quot;31&quot;,
        &quot;questions&quot;: [
           {
              &quot;topics&quot;: [{&quot;topic&quot;:  &quot;Malaria&quot; }],
              &quot;keepPrivate&quot; : false,
              &quot;validQuestion&quot; : true,
              &quot;question&quot;: &quot;2nd test question to see if it will be added&quot;,
              &quot;askedAt&quot;: &quot;2021-03-10T06:02:03.456&quot;
            }
        ]
  }
  </code></pre>
  <p>I end up with the new question being added twice.</p>
  <pre><code>{
      &quot;_id&quot;: &quot;6060f7a3ff557c7a21b99d1f&quot;,
      &quot;user&quot;: &quot;3b0939b6-93e9-4ba8-b183-82819cf99999&quot;,
      &quot;name&quot;: &quot;Max Headroom&quot;,
      &quot;age&quot;: &quot;30&quot;,
      &quot;questions&quot;: [
          {
              &quot;_id&quot;: &quot;6060f8faff557c7a21b99d23&quot;,
              &quot;topics&quot;: [
                  {
                      &quot;_id&quot;: &quot;6060f8faff557c7a21b99d24&quot;,
                      &quot;topic&quot;: &quot;Malaria&quot;
                  }
              ],
              &quot;keepPrivate&quot;: false,
              &quot;validQuestion&quot;: true,
              &quot;question&quot;: &quot;2nd test question to see if it will be added&quot;,
              &quot;askedAt&quot;: &quot;2021-03-10T06:02:03.456Z&quot;
          },
          {
              &quot;_id&quot;: &quot;6060f8faff557c7a21b99d23&quot;,
              &quot;topics&quot;: [
                  {
                      &quot;_id&quot;: &quot;6060f8faff557c7a21b99d24&quot;,
                      &quot;topic&quot;: &quot;Malaria&quot;
                  }
              ],
              &quot;keepPrivate&quot;: false,
              &quot;validQuestion&quot;: true,
              &quot;question&quot;: &quot;2nd test question to see if it will be added&quot;,
              &quot;askedAt&quot;: &quot;2021-03-10T06:02:03.456Z&quot;
          },
          {
              &quot;_id&quot;: &quot;6060f7a3ff557c7a21b99d20&quot;,
              &quot;topics&quot;: [
                  {
                      &quot;_id&quot;: &quot;6060f7a3ff557c7a21b99d21&quot;,
                      &quot;topic&quot;: &quot;Malaria&quot;
                  }
              ],
              &quot;keepPrivate&quot;: false,
              &quot;validQuestion&quot;: true,
              &quot;question&quot;: &quot;1st test question to see if it will be added&quot;,
              &quot;askedAt&quot;: &quot;2021-03-08T22:15:10.123Z&quot;
          }
      ],
      &quot;__v&quot;: 0
  }
  </code></pre>
  <p>What do I need to do to get Mongo to only add the new question once?</p>