src/adapters/nosql/mongo.js
/**
 * Update single document in database
 * @param {object} item document to be updated in database
 */
Update single document in database
@param {object} item document to be updated in database
Update single document in database @param { object } item document to be updated in database
updateDocument(collectionName, item) {
    this.db.collection(collectionName).findAndModify(
      this.getWhereQuery(item), 
      [['_id','asc']],  
      {$set: item }, 
      { upsert: true }, 
      function(err, object) {
          if (err){
              logger.warn(err.message);  
          }
        });
  }
updateDocument ( collectionName , item ) { this . db . collection ( collectionName ) . findAndModify ( this . getWhereQuery ( item ) , [ [ '_id' , 'asc' ] ] , { $set : item } , { upsert : true } , function ( err , object ) { if ( err ) { logger . warn ( err . message ) ; } } ) ; }
Update single document in database
 @param {object} item document to be updated in database
Update single document in database @param { object } item document to be updated in database
// query // sort order // replacement, replaces only the field "hi" TODO: Apply the very same format ElasticSearch module have // options // returns error if no matching object found