You would think that this would be an easy question to answer.
How do I, in Java, filter by an entity’s key (not a property that just happens to be of type Key, but its actual key – what we would call the “primary key” in relational database land)?
I don’t want to get a single entity with a particular key. I actually do want to do a filter and return a subset of the entities.
The trick is to use
Entity.KEY_RESERVED_PROPERTYin place of property name:This will find all
MyEntityentities with key greater thansomevalue.