How can I load all entities of a given kind from Cloud Datastore with Objectify?
Asked Answered
R

1

6

I have about a hundred objects stored in the Cloud Datastore with Kind = Animal. I would like to get all Animals from the database via the low level API or with Objectify.

Randolphrandom answered 13/1, 2015 at 1:25 Comment(0)
F
16

With Objectify you can do the following:

List<Animal> animals = ofy().load().type(Animal.class).list();

Read the documentation on queries it explains in detail how to query the Datastore using Objectify. In some ways I find the Objectify documentation to be much simpler to understand and concise compared to the GAE documentation.

Footwork answered 13/1, 2015 at 17:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.