overload upsert (id, data)
This commit is contained in:
parent
fdb142ecbf
commit
e480e29943
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue