How to get all entities in the application data store?

at http://code.google.com/appengine/docs/python/datastore/entities.html#Saving_Getting_and_Deleting_Entities

a batch operation to obtain an object is indicated below:

Batch get. entity = db.get ([k1, k2, k3])

How can I get all objects without providing keys?

+3
source share
2 answers

I have a solution on this and can be found in the Datastore Queries - an example of a query interface :

Query q = new Query("Person") 
        PreparedQuery pq = datastore.prepare(q);  
    for (Entity result : pq.asIterable()) {   
       String firstName = (String) result.getProperty("firstName");   
       String lastName = (String) result.getProperty("lastName");   
       Long height = (Long) result.getProperty("height");   
       System.out.println(lastName + " " + firstName + ", " + height.toString() + "inches tall"); 
}

I did not add a filter to the query, since it returned all entities from the data store.

+3
source

gql , fetch . . , StringKey, :

entities = db.gql("WHERE StringKey >''").fetch(1000)

, 1000 , GAE, . .

0

Source: https://habr.com/ru/post/1790425/


All Articles