1
votes

I was wondering how does Datastore Viewer from the AppEngine admin panel, order the entities?

I know I can run queries on the datastore and sort them any way I wish, but I would like to be able to see the latest entities added to a kind when I go in the Datastore Viewer. Instead, the entities returned by the Datastore Viewer are rather in a random order or ordered by the fist property.

This index.yaml configuration (which indicates to order by date property) seems to have no effect on the results returned by the Datastore Viewer:

indexes:
- kind: HitLog
  ancestor: yes
  properties:
  - name: Date
    direction: desc
1

1 Answers

2
votes

I'm guessing the admin page entities are sorted by their Key (name/id). Id's aren't generated in order, so you'll end up with a pretty random looking sort order.

AFAIK, there's no way to use configure the Datastore Viewer except to specify your own custom GQL query on the Datastore Viewer page.

Frankly though the Datastore Viewer becomes less and less useful as your data set gets larger, you generally have to end up writing your own tools.

Hm, a better datastore viewer would be a good open source project.