【问题标题】:Query a listValue in an Entity using Google Datastore API使用 Google Datastore API 查询实体中的 listValue
【发布时间】:2014-06-30 07:50:38
【问题描述】:

是否可以使用Google Cloud Datastore API 从实体中查询 listValue。

例如,如果我有一个博客的帖子实体:

[
  {
    "title": "My First Post",
    "tags": ["google", "android"]
  },
  {
    "title": "My Second Post",
    "tags": ["google"]
  }
]

显然,上面的数据将被正确标记(例如,使用 listValue、stringValue 等)。是否可以进行查询以向我提供标签等于“android”的所有 Post 实体。

我已经尝试了几件事,但都没有成功。标准和 GQL 查询。我什至尝试应用一些 GQL 查询,这些查询在使用来自 Google App Engine 实例(python)的 Datastore 时通常可以工作,但它们似乎不适用于Google Cloud Datastore API

任何帮助将不胜感激。

【问题讨论】:

  • 确保此“标签”属性已编入索引。
  • @AndreiVolgin 是的,它已编入索引。

标签: google-app-engine google-cloud-datastore


【解决方案1】:

发现问题。我今天早上开始调试,发现正在发送的过滤器未定义。

在深夜编码会议期间,您总是会错过类似的东西。

【讨论】:

    猜你喜欢
    • 2016-05-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-08-07
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多