gpt4 book ai didi

google-app-engine - JDO 在 GAE 上查询

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

我如何查询实体的某个字段所在的实体列表或(如数据存储查看器中所示)。

Query query = pm.newQuery(DataObject.class, "this.SomeString == null");

上面的代码对我不起作用,尽管数据存储中存在 SomeString 所在的实体,或者在使用数据存储查看器查看实体时。

最佳答案

您无法查询缺失值。来自 Restrictions on Queries :

Entities lacking a property named in the query are ignored.

Entities of the same kind need not have the same properties. To be eligible as a query result, an entity must possess a value (possibly null) for every property named in the query's filters and sort orders. If not, the entity is omitted from the indexes used to execute the query and consequently will not be included in the query's results.


您可以按 null 过滤,但是,这样您的查询的一部分应该可以工作。

关于google-app-engine - JDO 在 GAE 上查询 <missing> 和 <null> 值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13461174/

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