I can't understand what this error means and apparently, no one ever got the same error on the internet
BadArgumentError: _MultiQuery with cursors requires
__key__
order
This happens here:
return SocialNotification.query().order(-SocialNotification.date).filter(SocialNotification.source_key.IN(nodes_list)).fetch_page(10)
The property source_key
is obviously a key and nodes_list
is a list of entity keys previously retrieved.
What I need is to find all the SocialNotifications
that have a field source_key
that match one of the keys in the list.
The error message tries to tell you you that queries involving IN and cursors must be ordered by __key__
(which is the internal name for the key of the entity). (This is needed so that the results can be properly merged and made unique.) In this case you have to replace your .order()
call with .order(SocialNotification._key)
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With