【发布时间】:2018-05-10 06:14:27
【问题描述】:
我正在使用谷歌云数据存储 python 客户端将实体写入包含嵌入式实体的数据存储。示例实体可能如下所示:
data_type: 1
raw_bytes: <unindexed blob>
values: <indexed embedded entity>
我从控制台检查了数据,数据正确保存并且值存在。
接下来,我需要从 python 应用引擎应用程序运行查询。我在我的应用引擎代码中将上述内容表示为以下实体:
class DataValues(ndb.Model):
param1 = ndb.BooleanProperty()
param2 = ndb.IntegerProperty()
param3 = ndb.IntegerProperty()
class MyEntity(ndb.Expando):
data_type = ndb.IntegerProperty(required=True)
raw_bytes = ndb.BlobProperty()
values = ndb.StructuredProperty(DataValues)
查询中的一个过滤器取决于values 中的属性。查询示例代码如下:
MyEntity.query().filter(MyEntity.data_type == 1).filter(MyEntity.values.param1 == True).get()
我已经在我的 index.yaml 中创建了相应的复合索引
查询成功运行,但生成的实体包含嵌入实体 values 为无。所有其他属性值都存在。
这可能是什么问题?
【问题讨论】:
标签: google-app-engine google-cloud-datastore app-engine-ndb google-app-engine-python