summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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));