python - ID 未返回 Google App Engine 数据存储区中的任何内容

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

我试过 select * from post 返回所有帖子。如何使用 post_id 仅对一篇文章进行选择?我试过了

Select * from post where id='5629499534213120' 
select * from post where post_id='5629499534213120' 
select * from post where NAME/ID='5629499534213120'

它没有返回任何东西。

下面是我的帖子表的图片

Post Table

下面是详细 View 。

detailed view

最佳答案

一般来说,您可能希望使用键文字进行查询:

SELECT * FROM Post WHERE __key__ = KEY('Post', 5629499534213120)

还有一点要注意——键可以有字符串或整数 ID。默认情况下,ID 是整数,所以我在上面的查询中使用了整数。

关于python - ID 未返回 Google App Engine 数据存储区中的任何内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39731674/

相关文章:

Python 请求 : Handling JSON response, 存储到列表或字典?

python - 搜索某些 txt 的正则表达式模式的算法

google-app-engine - API 调用 datastore_v3.Put() 需要比可用配额更多的配额

java - 使用线程测试 GAE 数据存储

PyCharm 中的 Python 错误消息 : Unable to attach to shared memory segment

python - stat : path should be string, 字节,os.PathLike 或整数,不是 NoneType - refextract

php - 慢查询 - GAE PHP 和 Cloud SQL

google-cloud-datastore - Google Datastore 复合索引问题

java - 如何在java中将json字符串中的多条记录插入到google数据存储中

java - 错误: appengine-maven-plugin:1. 3.2:运行失败:非零退出:1