Skip to content

Datastore Query generates Bad Request with select+filter attached. #1016

@chriseaton

Description

@chriseaton

I have a pretty basic entity and am attempting to leverage a query to select it. But when I use the "select" function on the query (in conjunction with a "filter"), and then run the query, it generates a Bad Request error. Removing the "select" allows the query to run ok.

I can run either select or filter independently and they both work ok.

Failing query:

var qry = ds.createQuery('SocialMedia')
    .select(['id'])
    .filter('id =', items[0].id);
ds.runQuery(qry, function(err, entities) {
 ...

Creates Error:

{"errors":[],"code":400,"message":"Bad Request","response":{
"statusCode":400,"body":{"type":"Buffer","data": ...

Running

var qry = ds.createQuery('SocialMedia')
    .filter('id =', items[0].id);
ds.runQuery( ...

or

var qry = ds.createQuery('SocialMedia')
    .select(['id'])
ds.runQuery( ...

works fine and returns the results expected.

Metadata

Metadata

Assignees

Labels

api: datastoreIssues related to the Datastore API.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions