diff --git a/lib/dbwrap.js b/lib/dbwrap.js index c7ab8da..abf9a2e 100644 --- a/lib/dbwrap.js +++ b/lib/dbwrap.js @@ -149,6 +149,11 @@ function wrap(db, dir) { }; DB.upsert = function (id, data) { + if (!data) { + data = id; + id = data[idnameCased]; + } + return DB.set(id, data).then(function (result) { var success = result.changes >= 1; @@ -179,7 +184,6 @@ function wrap(db, dir) { } else { //console.log('[debug result of set]', result.sql); delete result.sql; - console.log(result); } return null;