both save and delete will not check existence of the record
windmaomao opened this issue · comments
Fang Jin commented
so i need to wrap it with get() first. It'll be great if the library can take care for me, so that i can do
db.delete(id, function(err) {
console.log(err);
if (err) {
next(err);
} else {
res.json({status: "success"});
}
});
instead of
db.get(id, function(err, item) {
if (err) {
next(err);
} else {
db.save(id, item, function(err) {
if (err) {
next(err);
} else {
item = db.getSync(id);
res.json(_attach_id(item, id));
}
});
}
});
Markus Kohlhase commented
does this commit change anything?
Markus Kohlhase commented
please reopen if it's not the case