Revert sort-only indexes
This commit is contained in:
parent
dee112a35c
commit
e39691763f
|
@ -163,14 +163,12 @@ BridgeToRedis.prototype.define = function (descr) {
|
|||
Object.keys(descr.properties).forEach(function (prop) {
|
||||
if (descr.properties[prop].index) {
|
||||
this.indexes[m][prop] = descr.properties[prop].type;
|
||||
this.indexes[m][prop].kind = descr.properties[prop].index;
|
||||
}
|
||||
}.bind(this));
|
||||
};
|
||||
|
||||
BridgeToRedis.prototype.defineForeignKey = function (model, key, cb) {
|
||||
this.indexes[model][key] = Number;
|
||||
this.indexes[model][key].kind = true;
|
||||
cb(null, Number);
|
||||
};
|
||||
|
||||
|
@ -220,9 +218,6 @@ BridgeToRedis.prototype.updateIndexes = function (model, id, data, callback, pre
|
|||
schedule.push(['SADD', 's:' + model, id]);
|
||||
}
|
||||
Object.keys(i).forEach(function (key) {
|
||||
if (i === 'sort') {
|
||||
return true;
|
||||
}
|
||||
if (data.hasOwnProperty(key)) {
|
||||
var val = data[key];
|
||||
schedule.push([
|
||||
|
@ -333,14 +328,13 @@ BridgeToRedis.prototype.possibleIndexes = function (model, filter) {
|
|||
var noIndex = [];
|
||||
Object.keys(filter.where).forEach(function (key) {
|
||||
var i = this.indexes[model][key];
|
||||
if (i.kind !== 'sort') {
|
||||
if (i) {
|
||||
var val = filter.where[key];
|
||||
if (i.name === 'Date') {
|
||||
val = val && val.getTime ? val.getTime() : 0;
|
||||
}
|
||||
foundIndex.push('i:' + model + ':' + key + ':' + val);
|
||||
} else {
|
||||
console.log('noindex', i, key);
|
||||
noIndex.push(key);
|
||||
}
|
||||
}.bind(this));
|
||||
|
|
Loading…
Reference in New Issue