diff --git a/client.js b/client.js index 8c5acb7..6714ed4 100644 --- a/client.js +++ b/client.js @@ -73,32 +73,32 @@ function($rootScope, MeteorCollections, $meteorObject) { } }) } - Collection.find = function(selector, options, callback) { + Collection.find = function(selector, options) { value = this instanceof Collection ? this : []; this.observe(collection.find(selector, options), true); return value; } - Collection.findOne = function(selector, options, callback) { + Collection.findOne = function(selector, options) { value = this instanceof Collection ? this : {}; value = new $meteorObject(collection,collection.find(selector,options).fetch()[0]); this.observe(collection.find(selector, options), false); return value; } - Collection.insert = function(values) { + Collection.insert = function(values, callback) { values = angular.copy(values); cleanupAngularObject(values); - return collection.insert(values); + return collection.insert(values, callback); } - Collection.update = function(selector, updateValues) { + Collection.update = function(selector, updateValues, callback) { updateValues = angular.copy(updateValues); cleanupAngularObject(updateValues); delete updateValues._id; return collection.update(selector, { $set : updateValues - }); + }, callback); } - Collection.remove = function(selector) { - return collection.remove(selector); + Collection.remove = function(selector, callback) { + return collection.remove(selector, callback); } return Collection; }