title: mongoDB updateMany with upsert true and $in in where condition
body: <p>How to insert many records if where condition does not meet with upsert true, for example consider below query, </p>
  
  <pre><code>db.getCollection('Llog').updateMany(
  {"macID" : {$in : [1,2]}}, 
  {$push : { "logDetails" : { $each : [{ wk: 15, score: 15 }] }}}, 
  {upsert : true}
  ) 
  </code></pre>
  
  <p>in my where condition i use "$in" [1,2], if there is record for macID : 1 then i should update the record with "logDetails", if i do not find record for macID : 2 then i need to insert record. If i find both records exist then update both Or if i find both records not exist then insert.</p>
  
  <p>For the above code, it inserts record as below, if both are not exist</p>
  
  <pre><code>{
      "_id" : ObjectId("59f18e68c19f798cffa406a8"),
      "logDetails" : [ 
          {
              "wk" : 15,
              "score" : 15
          }
      ]
  }
  </code></pre>
  
  <p>For example, if macId : 1 is available then i do the 1st set of updateMany code, then it should update macID : 1 and insert macID : 2, but it does not insert macID : 2 but it updates macID : 1.</p>