summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Fridman <fridman@mail.sfsu.edu>2015-04-12 14:57:54 -0400
committerSean Fridman <fridman@mail.sfsu.edu>2015-04-12 14:58:43 -0400
commit952cac06cc8ccd66fe07b09ca81c5dc750a54805 (patch)
treed5869a56af9c9bf11013c95d163c882f79d287ed
parent65c1c6541f98eb863f9a19533f4bdb4bd9e38514 (diff)
Fix bug in FSDB.find
-rw-r--r--app/node_modules/okdb/index.js5
1 files changed, 3 insertions, 2 deletions
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));