I found that if I used my query a few times on the development server
then your above code snippet was automatically inserted in my
index.yaml - neat! (not app.yaml)
Then when I uploaded to Google App Engine I got errors for a few
minutes while the index was building, but eventually it worked.
On Oct 30, 12:02 pm, ryan baldwin <
ryanbald...@gmail.com> wrote:
> In my example I left out the sorts by A ascending because I later realised
> it may not be necessary... I believe, however, that my index *does* sort by
> createdDate ascending... I haven't written one in a long, long time, so my
> apologies. ;)
>
> - ryan.
>
> On Thu, Oct 29, 2009 at 7:01 PM, ryan baldwin <
ryanbald...@gmail.com> wrote:
> > I believe you can create an index that sorts by youngest, then by name, and
> > you should be good. Assuming your "youngest" field is called "createdDate".
>
> > In app.yaml:
>
> > - kind: MyModel
> > properties:
> > - name: createdDate
> > direction: asc
>
> > If I understand what I just typed, that will create an index on the MyModel
> > entity, ordering first by createdDate ascending then by A ascending. You
> > could, I believe, then do the following:
>
> > MyModel.all().filter=('A =', 123).order(createdDate).fetch(limit=20)
>
> > That being said, I'm not sure if DataStore actually guarantees the order of
> > results... I assume so...?
>
> > - ryan.
>