title: Mongodb Add to array if exists
body: <pre><code>   {
         'ID': 'IDexample',
         'Coordinates'  : [
             {'CoordinateX' :  123,
              'CoordinateY':  5
             },
             {'CoordinateX' :  54,
              'CoordinateY':  23'
             }
          ]
      }
  </code></pre>
  
  <p>How can I add 2 elements to array Coordinates if "IDexample" is present in coordinatesCollection ? If not exist add new Document' to collection.
  I am using MongoClient and the name of the collection is  coordinatesCollection.</p>
  
  <pre><code> coordinatesCollection.findOne( { "unique_id" : unique_id }, function(err, object){
      if (object) {
        ????
      } else {
        coordinatesCollection.insert({
          "unique_id" : unique_id,
          "coordinates" : [
            {"coordinateX" :msg.coordinatex,
             "coordinateY" : msg.coordinatey
            }
          ]
        })
      }
    });
  </code></pre>