Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do App Engine datastore queries have a default sort order?

Is there a default sort order for the returned values of App Engine datastore queries? If so what is it?

like image 520
Dan Avatar asked Nov 25 '14 18:11

Dan


People also ask

What is the query language we can use with Datastore?

The Python Datastore API provides two classes for preparing and executing queries: Query uses method calls to prepare the query. GqlQuery uses a SQL-like query language called GQL to prepare the query from a query string.

What is ancestor in Datastore?

For highly related or hierarchical data, Datastore allows entities to be stored in a parent/child relationship. This is known as an entity group or ancestor/descendent relationship. This is an example of an entity group with kinds of types person, pet, and toy. The 'Grandparent' in this relationship is the 'Person'.

How do I update entity in Datastore?

To update an existing entity, modify the attributes of the Entity object, then pass it to the DatastoreService. put() method. The object data overwrites the existing entity. The entire object is sent to Datastore with every call to put() .

How do I delete all entities in Datastore?

Open "Datastore Admin" for your application and enable Admin. Then all of your entities will be listed with check boxes. You can simply select the unwanted entites and delete them.


1 Answers

By default, you get key order, and key order depends on whether you took the default id or supplied a key name, and if the former, whether you used the default policy for key allocation. The doc says "the default policy generates a random sequence of IDs that are approximately uniformly distributed. Each ID can be up to 16 decimal digits long."

The "16 digit" part is interesting. Basically, keys are 53 bits--the fraction part of an IEEE double. JavaScript uses IEEE doubles, so 53 bits is the largest integer value that you can safely round-trip through JSON.

like image 165
Dave W. Smith Avatar answered Sep 29 '22 09:09

Dave W. Smith