- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试使用 google-api-nodejs-client 对我的 Google Cloud 数据存储区运行简单查询。我想查询与给定类型匹配的所有实体。当我使用 the "Try it now" tool 运行此查询时它工作正常:
Request
POST https://www.googleapis.com/datastore/v1beta2/datasets/healthier-staging/runQuery?key={YOUR_API_KEY}
{
"query": {
"kinds": [
{
"name": "Subscriber"
}
]
}
}
Response
200 OK
{
"batch": {
"entityResultType": "FULL",
"entityResults": [
{
"entity": {
"key": {
"partitionId": {
"datasetId": "s~healthier-staging"
},
"path": [
{
"kind": "Subscriber",
"name": "+1215XXXXXXX"
}
]
},
"properties": {
...
我能够使用我的凭据进行身份验证、创建交易等,因此我知道这不是身份验证问题。
这是我尝试在 Node 中运行的代码:
this.datastore.runQuery({
datasetId: 'healthier-staging',
query: {
kinds: [{name: 'Subscriber'}]
},
}, (function(err, result) {
if (err) {
console.error(err);
return;
}
}).bind(this));
当我尝试使用 Node 模块运行相同的查询时,出现此错误:
{ [Error: one of fields Query.query and Query.gql_query must be set]
code: 400,
errors:
[ { domain: 'global',
reason: 'INVALID_ARGUMENT',
message: 'one of fields Query.query and Query.gql_query must be set' } ] }
这没有意义,因为我已经指定了 query
字段。我尝试过各种方法:删除 datasetId
(产生需要 datasetId
的错误),使用 gql_query
代替(相同的错误),封装事务内的 datasetId
并将其传递到 readOptions
等中。
这是一个错误还是我做了一些愚蠢的事情?
谢谢!
最佳答案
我在你的 other StackOverflow question 上提到过这一点,但您的请求应包含在资源部分中:
this.datastore.runQuery({
datasetId: 'healthier-staging',
resource: {
query: {
kinds: [{name: 'Subscriber'}]
},
},
}, (function(err, result) {
if (err) {
console.error(err);
return;
}
}).bind(this));
关于javascript - 每次运行 datastore.runQuery : one of fields Query. 查询时都会出错,并且必须设置 Query.gql_query,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31094523/
我正在尝试用我以前的类(class)笔记填充数据存储,以便将来我可以添加评论板或留言簿等笔记。 我似乎无法在数据存储中获取以前的注释,并且一直在翻阅 GAE 文档并在网上搜索无济于事。 这是我的代码:
我得到以下异常: Exception in thread "main" com.google.cloud.datastore.DatastoreException: no matching index
我们有一个在美国和欧盟托管的应用。为了获得出色的性能,我们将在两个位置托管一个数据存储实例。 现在的问题是如何将数据从美国数据存储复制到欧盟数据存储? 或者从技术角度来看,我们将数据存储在哪里并不重要
当我调用 datastore.save 方法时,我偶尔会遇到以下错误: 错误:在/user_code/node_modules/@google-cloud/datastore/node_modules
我正在使用适用于 Datastore (google-cloud-datastore) 版本 1.4.0 的 Python 客户端 SDK。我正在尝试运行仅键查询获取: query = client.
我正在试验 Google App Engine's flexible Python 3 environment and Cloud Datastore .在本地测试时,这(通常)要求在类似 Gunic
Google Cloud Datastore 是否支持计数器等原子操作?我在文档中没有看到任何相关内容,我注意到更新基本上是获取整个对象,更新一个字段,然后将整个对象发送回去,这似乎会使原子操作变得不
我的数据存储实体将具有 embedded entity type 的属性. 在我将它们保存如下后( 我正在使用 gcloud v0.27.0 ): dataset.save([{ key: d
是com.google.cloud.datastore.Datastore线程安全?更具体地说,Datastore 的一个实例可以吗?由多个线程共享,并且它们都可以同时读取/写入云数据存储吗? 换句话
Cloud Dataflow页面暗示这是可能的,但我还没有在 Google Cloud Datastore 文档中找到观察更改事件的方法。它是如何完成的? 最佳答案 据我所知,Cloud Datast
Google Cloud Firestore 将很快取代旧的 Google Cloud Datastore。然后可以选择在“ native 模式”或“数据存储模式”下使用 Cloud Firestor
我是 Datastore 的新手,我正在尝试创建一个简单的应用程序来跟踪图书借阅情况。 我希望数据库架构如下: books: book_id name: borrowing: time
这个问题已经被回答过很多次了,但答案似乎总是在变化。 我正在使用 Java 在 Windows 中工作,并且有一个本地数据存储实例,我希望将其作为生产的副本。 之前有两个答案:- How to cre
如何通过 Google Cloud Datastore 中的 API(Python Protocol Buffer )删除整个祖先树? 例如,如果我将实体存储在此结构中:祖父/父/子,我如何删除祖父,
我想在 Google Cloud Datastore(Datastore 模式下的 Firestore)中保存一部分结构。 以电话簿和联系人为例。 type Contact struct { Ke
我正在尝试看看仅使用 Cloud Functions 与 Datastore 交互是否可行。 有没有一种方法可以仅使用 Cloud Functions 创建复合索引(如 index.yaml)?因此只
我注册了 Firebase 以使用新的 Firestore。 尝试后,我决定,对于我的用例(主要是服务器工具),我不需要 Firestore 的大部分功能,这些功能非常专注于构建用户界面,而且我发现旧
我目前正在使用一台按顺序运行并从命名空间中读取实体的机器执行迁移,这对我来说很痛苦。是否可以使用 Google Cloud Dataflow 更轻松地执行迁移? 最佳答案 您应该能够使用 Datast
我想在 MongoDB 中使用 Grails2.5 中的“ElasticSearch”插件。我的“BuildConfig.groovy”文件是: grails.servlet.version = "3
我想从 Rails 应用程序中使用 Google Cloud Datastore。任何 Ruby 库都可以让这一切变得简单? 最佳答案 您可以使用官方的 Google API Client for R
我是一名优秀的程序员,十分优秀!