Skip to content

Commit

Permalink
Merge pull request #26 from silvolu/master
Browse files Browse the repository at this point in the history
Fix for wrong declaration of 'value' for property filters
  • Loading branch information
Burcu Dogan committed Jul 21, 2014
2 parents e7d8b00 + f1ef8e3 commit 3ba8335
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/datastore/entity.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ var queryToQueryProto = function(q) {
if (f.name === '__key__') {
val.keyValue = keyToKeyProto(null, f.val);
} else {
val.properties = valueToProperty(f.val);
val = valueToProperty(f.val);
}
var property = {
property: { name: f.name },
Expand Down
4 changes: 1 addition & 3 deletions test/datastore.entity.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,9 +282,7 @@ var queryFilterProto = {
},
"operator": "EQUAL",
"value": {
"properties": {
"stringValue": "John"
}
"stringValue": "John"
}
}
}, {
Expand Down
2 changes: 1 addition & 1 deletion test/testdata/proto_query.json
Original file line number Diff line number Diff line change
@@ -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}
{"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 comments on commit 3ba8335

Please sign in to comment.