learner
learner

Reputation: 11780

datastore keys query in sorted order for given keys

I have a set of keys ( Set<Key> keys). To query the datastore for their entities, I can do datastore.get(keys). How do I change my query so that the result is ordered by a certain property? say, price?

Upvotes: 0

Views: 241

Answers (1)

Andrei Volgin
Andrei Volgin

Reputation: 41089

Since you already have the keys, there is no point to run a new query. Get your entities (you will have a map, for example results) and sort them by any property like you would normally sort a collection (results.values()).

Upvotes: 1

Related Questions