Reputation: 1086
How do I run a projection query using keys ? I would like to be able to select using a list of keys and then project on a property.
ofy().load().type(Entity.class).filterKey(" in ", keys).project("property1")
I got an error message saying: '__key_ _ in ' is not a legal filter condition
Also I tried to query by ids which also did not work.
// convert keys to ids
// ...
// ...
ofy().load.type(Entity.class).filter(" id in ", ids).project("property1");
I got an error message saying I cannot use id in filter.
I remember being able to do this using the low level datastore api. Please let me know if there is a way using objectify.
Regards,
Sathya
Upvotes: 1
Views: 940
Reputation: 13556
Get rid of your extra spaces in filterKey(" in ", ...)
. It should be filterKey("in", ...)
.
It never occurred to me that anyone would try something that wacky. And apparently Java String.split()
is pedantic about splitting for every instance of characters. Thank you for discovering this bug; the fix will be in the next version of Objectify (5.0.4).
In the mean time, stop doing dumb things with whitespace.
Upvotes: 1