【发布时间】:2015-01-21 01:54:40
【问题描述】:
如何在 GQL 中编写以下查询? [1]
Contact.query(Contact.address == Address(city='San Francisco',
street='Spear St'))
【问题讨论】:
标签: google-app-engine google-cloud-datastore
如何在 GQL 中编写以下查询? [1]
Contact.query(Contact.address == Address(city='San Francisco',
street='Spear St'))
【问题讨论】:
标签: google-app-engine google-cloud-datastore
引用 https://cloud.google.com/appengine/docs/python/ndb/queries#gql ,“要查询包含结构化属性的模型,您可以在 GQL 语法中使用 foo.bar 来引用子属性”——如果我正确理解您的任务,
'''SELECT * FROM Contact
WHERE address.city='San Francisco' AND
address.street='Spear St'
'''
应该可以。不是吗?
【讨论】: