Merge pull request #14 from CartoDB/filter-avoid-dot-notation

Avoid using dot notation to allow complex keys
This commit is contained in:
Raul Ochoa 2016-04-27 15:12:51 +02:00
commit 860bc0adeb

View File

@ -92,7 +92,7 @@ tree.Filterset.prototype.toJS = function(env) {
val = filter._val.toString(true);
}
var attrs = "data";
return attrs + "." + filter.key.value + " " + op + " " + (val.is === 'string' ? "'" + val.toString().replace(/'/g, "\\'") + "'" : val);
return attrs + "['" + filter.key.value + "'] " + op + " " + (val.is === 'string' ? "'" + val.toString().replace(/'/g, "\\'") + "'" : val);
}).join(' && ');
};