How to construct GQL to not contain a value from a set?

后端 未结 1 1793
长情又很酷
长情又很酷 2021-01-20 21:10

Is it possible to select from a google app engine db where the key of a db.Model object is not in a given list? If so, what would be the syntax?

Ex of

相关标签:
1条回答
  • 2021-01-20 21:31

    No Though app engine supports an "IN" query, it does not support a "NOT IN" query.

    However, if your list of entities you don't want is small, then you might as well just retrieve every entity and filter out the ones you don't need yourself.

    Alternatively, if the list of entities you want to exclude is a large fraction of all entities, then the above solution would be rather inefficient. Instead, perhaps you could add an additional property to your model which you could use to filter out entities you don't want (whether or not this is possible will depend on your specific needs and data).

    0 讨论(0)
提交回复
热议问题