Fix redis2 indexes cleanup
This commit is contained in:
parent
cca1cbb3f8
commit
8cd1ec2e9e
|
@ -215,6 +215,12 @@ BridgeToRedis.prototype.save = function (model, data, callback) {
|
||||||
if (err) return callback(err);
|
if (err) return callback(err);
|
||||||
this.client.hmset([model + ':' + data.id, data], function (err) {
|
this.client.hmset([model + ':' + data.id, data], function (err) {
|
||||||
if (err) return callback(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));
|
this.updateIndexes(model, data.id, data, callback, this.forDb(model, prevData));
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "jugglingdb",
|
"name": "jugglingdb",
|
||||||
"description": "ORM for every database: redis, mysql, neo4j, mongodb, postgres, sqlite",
|
"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>",
|
"author": "Anatoliy Chakkaev <rpm1602@gmail.com>",
|
||||||
"contributors": [
|
"contributors": [
|
||||||
{ "name": "Anatoliy Chakkaev", "email": "rpm1602@gmail.com" },
|
{ "name": "Anatoliy Chakkaev", "email": "rpm1602@gmail.com" },
|
||||||
|
|
Loading…
Reference in New Issue