ferk86
ferk86

Reputation: 2345

Get all entities of same kind as list from Google Datastore?

Instead of a query like datastore.prepare(query).asList(FetchOptions.Builder.withLimit(5)), how do you get all the entities of the same kind as a list without a limit?

Upvotes: 0

Views: 2696

Answers (1)

Victor
Victor

Reputation: 8490

Use:

Query gaeQuery = new Query(entityName);
PreparedQuery pq = datastore.prepare(gaeQuery);
List<Entity> list = pq.asList(FetchOptions.Builder.withDefaults());

Upvotes: 3

Related Questions