From 952cac06cc8ccd66fe07b09ca81c5dc750a54805 Mon Sep 17 00:00:00 2001 From: Sean Fridman Date: Sun, 12 Apr 2015 14:57:54 -0400 Subject: Fix bug in FSDB.find --- app/node_modules/okdb/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'app/node_modules') diff --git a/app/node_modules/okdb/index.js b/app/node_modules/okdb/index.js index 2cf6d8b..85156d1 100644 --- a/app/node_modules/okdb/index.js +++ b/app/node_modules/okdb/index.js @@ -148,12 +148,13 @@ FSDB.prototype.sortBy = function(collection, prop, descend) { return resolve(result); }; -FSDB.prototype.find = function(collection, id) { +FSDB.prototype.find = function(collection, query) { var schema = this._schemas[collection]; if (!schema) return resolve(null, new Error('No such collection type')); + if (!query) + return resolve(null, new Error('Bad input')); - var query = getQuery(schema, id); var result = this._db(collection).find(query); return resolve(cloneDeep(result)); -- cgit v1.2.3-70-g09d2