diff options
| -rw-r--r-- | app/node_modules/okdb/index.js | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/app/node_modules/okdb/index.js b/app/node_modules/okdb/index.js index 5368e4a..79ce1eb 100644 --- a/app/node_modules/okdb/index.js +++ b/app/node_modules/okdb/index.js @@ -48,10 +48,10 @@ FSDB.prototype._resolve = function(data, error) { }; FSDB.prototype.get = function(collection, query) { - var data = this._db(collection).find(query); if (!query) { return this._resolve(null, new Error('No query given')); } else { + var data = this._db(collection).find(query); return this._resolve(data); } }; @@ -85,8 +85,13 @@ FSDB.prototype.remove = function(collection, id, data) { throw new Error('Not implemented!'); }; -FSDB.prototype.find = function(collection, id, data) { - throw new Error('Not implemented!'); +FSDB.prototype.find = function(collection, query) { + if (!collection || !query) { + return this._resolve(null, new Error('Bad input')); + } else { + var data = this._db(collection).find(query); + return this._resolve(data); + } }; FSDB.prototype.getMeta = function() { |
