简体   繁体   中英

AppEngine Datastore query with inequality and sort (different attribute). Workaround?

Hey guys I know this is an old issue but I am wondering if there any news about it: I have a simple query where I want to do:

filter('created >=', somedatetime).order('-counter')

I tried: filter('created >=', somedatetime).order('-created').order('-counter') but because created is a datetime the results are pretty bad.

A user can go through a list with infinite scrolling and we can choose a time window of 7,30,90 days but it seems I cannot this very simple query.

I was thinking of break created to two attributes (dayofyear, year) so that I could use the IN operator but this could be hard as I have about 2M entries.

Any ideas?

No, there's no way around this. This limitation exists due to how indexes are constructed. You'll simply have to do either the sorting or the filtering in memory, just as other databases would.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM