Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for wrong declaration of 'value' for property filters #26

Merged
merged 2 commits into from
Jul 21, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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}