cdsap
cdsap

Reputation: 133

AddFilter with ID/NAME

is possible with addFilter get a query with ID/Name of my Entity?

I try:

query.addFilter("_key_", Query.FilterOperator.EQUAL,18);

query.addFilter("id", Query.FilterOperator.EQUAL,18);

query.addFilter("ID/Name", Query.FilterOperator.EQUAL,18);

I saw responses from other users like How to retrieve Google Appengine Objects by id (Long value)?, but not in addFilter. Is possible?

Thx

Upvotes: 0

Views: 332

Answers (1)

proppy
proppy

Reputation: 10504

They key field is __key__, but I would recommend using datastore.get instead of a query for getting an entity by key.

Upvotes: 2

Related Questions