gpt4 book ai didi

google-app-engine - 具有多个不等式的 App Engine NDB 查询?

转载 作者:行者123 更新时间:2023-12-04 05:01:24 24 4
gpt4 key购买 nike

这里仅有的两个答案基本上涉及重构数据库以适应此限制,但我不确定在我的情况下如何做到这一点。

我有一个包含数千个联系人的列表,每个联系人都有许多属性。我正在制作一个能够同时过滤多个属性的页面。

例如:年龄 < 15、添加日期 > 15 天前、位置 == 圣克鲁斯等。可能需要大量的不等式过滤器。如何在 GAE 中实现这一目标?

最佳答案

根据 the docs (for python) ,

Limitations: The Datastore enforces some restrictions on queries. Violating these will cause it to raise exceptions. For example, combining too many filters, using inequalities for multiple properties, or combining an inequality with a sort order on a different property are all currently disallowed. Also filters referencing multiple properties sometimes require secondary indexes to be configured.



如果您在几个月后回来查看,这可能会改变。 GAE 变化很快。

不过,就目前而言,您必须进行多个查询并将它们组合到您的代码中。

关于google-app-engine - 具有多个不等式的 App Engine NDB 查询?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16114762/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com