Fix redis2 indexes cleanup

This commit is contained in:
Anatoliy Chakkaev 2012-09-25 08:39:23 +04:00
parent cca1cbb3f8
commit 8cd1ec2e9e
2 changed files with 7 additions and 1 deletions

View File

@ -215,6 +215,12 @@ BridgeToRedis.prototype.save = function (model, data, callback) {
if (err) return callback(err);
this.client.hmset([model + ':' + data.id, data], function (err) {
if (err) return callback(err);
if (prevData) {
Object.keys(prevData).forEach(function (k) {
if (data.hasOwnProperty(k)) return;
data[k] = prevData[k];
});
}
this.updateIndexes(model, data.id, data, callback, this.forDb(model, prevData));
}.bind(this));
}.bind(this));

View File

@ -1,7 +1,7 @@
{
"name": "jugglingdb",
"description": "ORM for every database: redis, mysql, neo4j, mongodb, postgres, sqlite",
"version": "0.1.18",
"version": "0.1.20",
"author": "Anatoliy Chakkaev <rpm1602@gmail.com>",
"contributors": [
{ "name": "Anatoliy Chakkaev", "email": "rpm1602@gmail.com" },