BadArgumentError: _MultiQuery with cursors requires __key__ order in ndb

后端 未结 5 2080
终归单人心
终归单人心 2021-01-18 01:27

I can\'t understand what this error means and apparently, no one ever got the same error on the internet

BadArgumentError: _MultiQuery with cursors re

5条回答
  •  花落未央
    2021-01-18 02:21

    I found the answer here: https://developers.google.com/appengine/docs/python/ndb/queries#cursors

    You can change your query to:

    SocialNotification.query().order(-SocialNotification.date, SocialNotification.key).filter(SocialNotification.source_key.IN(nodes_list)).fetch_page(10)

    in order to get this to work. Note that it seems to be slow (18 seconds) when nodes_list is large (1000 entities), at least on the Development server. I don't have a large amount of test data on a test server.

提交回复
热议问题