GQL 与 Node.js

问题描述 投票:0回答:3

有在 Node.js 中使用 Google Datastore GQL 的工作示例吗?

文档中的示例包含似乎不存在的 .execute 函数。

https://cloud.google.com/datastore/docs/concepts/gql

因此,我尝试使用常规回调方法,但未选择 GQL 语句。 我尝试过使用 gql_query 和 gqlQuery 作为资源参数名称,但无济于事。

store.datasets.runQuery(
        {
            "resource":
            {
                "gqlQuery":
                {
                    "queryString":"SELECT * from Messages LIMIT 50",
                    "allowLiterals":true
                }
            }

        }, 
        function(err, result, endCursor, apiResponse)
        {
...
    }
node.js google-cloud-datastore google-cloud-platform gql
3个回答
4
投票

我可能已经找到答案了:

文档指出“...适用于 Java 的 Google Cloud 客户端库支持 GQL,但其他 Google Cloud 客户端库不支持。”


1
投票

看起来他们已经添加了 Ruby,但仍然没有 Node.js :(

幸运的是,我需要相当于 GQL

CONTAINS
.filter('foo', '=', 'bar')
(在数组值上)似乎工作正常。


0
投票

我有一篇关于使用 NodeJS 查询 GQL 的库的文章。我希望它有帮助: Google 数据存储上的 NodeJS GQL 查询

© www.soinside.com 2019 - 2024. All rights reserved.