Skip to content

Commit 3ba8335

Browse files
author
Burcu Dogan
committed
Merge pull request #26 from silvolu/master
Fix for wrong declaration of 'value' for property filters
2 parents e7d8b00 + f1ef8e3 commit 3ba8335

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

lib/datastore/entity.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ var queryToQueryProto = function(q) {
269269
if (f.name === '__key__') {
270270
val.keyValue = keyToKeyProto(null, f.val);
271271
} else {
272-
val.properties = valueToProperty(f.val);
272+
val = valueToProperty(f.val);
273273
}
274274
var property = {
275275
property: { name: f.name },

test/datastore.entity.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -282,9 +282,7 @@ var queryFilterProto = {
282282
},
283283
"operator": "EQUAL",
284284
"value": {
285-
"properties": {
286-
"stringValue": "John"
287-
}
285+
"stringValue": "John"
288286
}
289287
}
290288
}, {

test/testdata/proto_query.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"projection":[{"property":{"name":"name"}},{"property":{"name":"count"}}],"kinds":[{"name":"Kind"}],"filter":{"compositeFilter":{"filters":[{"propertyFilter":{"property":{"name":"count"},"operator":"GREATER_THAN_OR_EQUAL","value":{"properties":{"integerValue":5}}}},{"propertyFilter":{"property":{"name":"name"},"operator":"EQUAL","value":{"properties":{"stringValue":"Burcu"}}}}],"operator":"AND"}},"order":[{"property":{"name":"count"},"direction":"DESCENDING"}],"groupBy":[{"name":"count"}],"startCursor":"cursor","offset":5,"limit":10}
1+
{"projection":[{"property":{"name":"name"}},{"property":{"name":"count"}}],"kinds":[{"name":"Kind"}],"filter":{"compositeFilter":{"filters":[{"propertyFilter":{"property":{"name":"count"},"operator":"GREATER_THAN_OR_EQUAL","value":{"integerValue":5}}},{"propertyFilter":{"property":{"name":"name"},"operator":"EQUAL","value":{"stringValue":"Burcu"}}}],"operator":"AND"}},"order":[{"property":{"name":"count"},"direction":"DESCENDING"}],"groupBy":[{"name":"count"}],"startCursor":"cursor","offset":5,"limit":10}

0 commit comments

Comments
 (0)