From 3c3cbc0b61262e1df1c813b78a81e24418f04750 Mon Sep 17 00:00:00 2001 From: Stelio Gouveia Date: Fri, 23 Sep 2016 16:54:31 +0200 Subject: [PATCH] Fleshed out update function --- index.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 38c93eb..4de51e9 100644 --- a/index.js +++ b/index.js @@ -429,9 +429,18 @@ var MongodbDriver = Base.extend({ return Promise.reject('There is no NoSQL implementation yet!'); }, - update: function() { - - return Promise.reject('There is no NoSQL implementation yet!'); + /** + * Update a record(s) of a collection + * @param collectionName - The collection to update + * @param query - The record(s) to update + * @param update - The update + * @param options + * @param callback + * @returns {*} + */ + update: function(collectionName, query, update, options, callback) { + return this._run('update', collectionName, {query: query, update: update, options: options}) + .nodeify(callback); } });