【问题标题】:Is there a way to connect nodejs to a local Google Datastore有没有办法将 nodejs 连接到本地 Google Datastore
【发布时间】:2014-04-07 22:03:33
【问题描述】:

使用 Java 和 Python 的 GAE 应用程序可以在开发模式下连接到本地 Datastore,然后发送到 appspot.com

我已将数据存储安装为本地开发服务器 https://developers.google.com/datastore/docs/tools/devserver

我想使用 nodejs 连接到本地数据存储,我阅读了这个 Google 教程以使用 nodejs 的数据存储,但我没有找到有关如何连接的任何信息

我遵循本教程,但这仅连接到 appstpot 数据存储。 https://developers.google.com/datastore/docs/getstarted/start_nodejs/

谢谢。

【问题讨论】:

    标签: node.js google-app-engine google-cloud-datastore


    【解决方案1】:

    现在您可以使用 gcloud,阅读以下位置的文档:

    https://googlecloudplatform.github.io/gcloud-node

    【讨论】:

      【解决方案2】:

      您可以在本地应用中使用datastore-emulator

      首先,安装 google-cloud 库。然后运行,

      gcloud auth login
      gcloud -q components install beta cloud-datastore-emulator
      gcloud -q beta emulators datastore start --no-store-on-disk --project='your_project_id'
      

      【讨论】:

        【解决方案3】:

        还没有。 Cloud Datastore nodejs 实现使用本地开发服务器尚不支持的 JSON。请参阅本页顶部的注释:https://developers.google.com/datastore/docs/tools/devserver

        【讨论】:

          【解决方案4】:

          当我使用gcloud.datastore.dataset({projectId: 'project-id']) 时,出现以下错误:

          gcloud.datastore.dataset 不是函数。

          只有当我设置var ds = cloud.datastore({projectId: 'project-id'])时才有效。

          【讨论】:

            猜你喜欢
            • 1970-01-01
            • 2020-11-28
            • 1970-01-01
            • 2020-07-29
            • 1970-01-01
            • 2023-02-10
            • 2017-09-09
            • 1970-01-01
            • 2021-03-17
            相关资源
            最近更新 更多