Enclose string values in double quotes

This commit is contained in:
jos 2018-07-02 22:09:40 +02:00
parent 066f5d37e6
commit fdbfa8a951
2 changed files with 9 additions and 3 deletions

View File

@ -175,10 +175,12 @@ function showTransformModal (node, container) {
function generateQueryFromWizard () { function generateQueryFromWizard () {
if (filterField.value && filterRelation.value && filterValue.value) { if (filterField.value && filterRelation.value && filterValue.value) {
var field1 = filterField.value; var field1 = filterField.value;
// TODO: move _stringCast into a static util function
var value1 = JSON.stringify(node._stringCast(filterValue.value));
query.value = '[? ' + query.value = '[? ' +
field1 + ' ' + field1 + ' ' +
filterRelation.value + ' ' + filterRelation.value + ' ' +
'`' + filterValue.value + '`' + '`' + value1 + '`' +
']'; ']';
} }
else { else {

View File

@ -60,14 +60,18 @@
object: { a: 2, b: 3} object: { a: 2, b: 3}
}; };
for (var i = 0; i < 10000; i++) { for (var i = 0; i < 10000; i++) {
var longitude = 4 + i / 10000;
var latitude = 51 + i / 10000;
json.numbers.push(i); json.numbers.push(i);
json.array.push({ json.array.push({
name: 'Item ' + i, name: 'Item ' + i,
index: i, index: i,
time: new Date().toISOString(), time: new Date().toISOString(),
location: { location: {
latitude: 51 + i / 10000, latitude,
longitude: 4 + i / 10000, longitude,
coordinates: [longitude, latitude]
}, },
random: Math.random() random: Math.random()
}); });