title: Insert if not exists, if exists update
body: <p>I'm getting usersfrom this API.</p>
  
  <p><a href="https://redmine-mock-api.herokuapp.com/api/v1/users" rel="nofollow noreferrer">https://redmine-mock-api.herokuapp.com/api/v1/users</a></p>
  
  <p>There are 100 in total (100 different ids). I added them to my mongodb database using mongoose but the problem is that it's always adding (i already have 5000 users (50 times repeated 100 users)</p>
  
  <p>I want to add if the <code>id</code> does not exist or update if it exists.</p>
  
  <p>What am I doing wrong? <code>users</code> is the array of users from the API</p>
  
  <pre><code> db.collection("users").insertMany(users, function (error, response) {
                          if (error) throw error;
                          console.log("Number of users inserted: " + response.insertedCount);
                          db.close();
                      });
  </code></pre>