查询谷歌应用引擎中的日期时间

时间:2014-02-21 19:35:00

标签: google-app-engine gql

我无法在google app引擎中查询日期时间字段。我正在尝试运行以下查询 -

SELECT * FROM Email WHERE cmp_id='52d836ed1057c341b800013a' AND pushed_to_crm=TRUE AND ss_time >= DATETIME('2014-01-17 00:00:00')

我确信这应该返回一些行 - 我的意思是数据库中应该返回数据。

但是我在运行此查询时遇到错误 -

Learn more about GQL syntax.
no matching index found.
The suggested index for this query is:
- kind: Email
  properties:
  - name: cmp_id
  - name: pushed_to_crm
  - name: ss_time

字段ss_timedb.DateTimeProperty()。有什么东西我不见了吗?

1 个答案:

答案 0 :(得分:1)

错误信息非常清楚。您必须使用以下属性为您的电子邮件实体添加索引:cmp_idpushed_to_crmss_time

您可以将以下内容添加到index.yaml

- kind: Email
  properties:
  - name: cmp_id
  - name: pushed_to_crm
  - name: ss_time
相关问题