node.js - 如何计算node.js中谷歌数据存储中的记录(命名空间,种类)?

标签 node.js gcloud google-cloud-datastore

我正在使用 gcloud npm 模块。提前致谢。

我尝试了很多,但什么也没得到。

最佳答案

您需要对该实体进行查询并计算结果。

var query = ds.createQuery('EntityKind');

ds.runQuery(query, function(err, entities, info){
    if(err) { 
    // deal with error in here
    }

    var total = entities.length;

    // You should check if there are more result 
    // and maybe run the query again until there are no more result

    if (info.moreResults !== gcloud.datastore.NO_MORE_RESULTS) {
        // More result
    }

});

关于node.js - 如何计算node.js中谷歌数据存储中的记录(命名空间,种类)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37027614/

相关文章:

python - Google App Engine 模型类是如何存储的?

node.js - 如何限制 Node 中简化HTTP请求的内容长度响应?

node.js - 带 Passport 的 NodeJS 快速验证器

node.js - 如何在 aws amplify for node.js 中更改用户作为管理员的电子邮件或密码

docker - Kubectl无法在Windows 10上连接

python - 我可以通过 _pre_put_hook 导致 put 失败吗?

javascript - 将变量从 Jquery 传递到 Node 以运行 git 命令

python - 我可以使用任何 stackdriver 监控 api 或 gcloud 命令获得 gcp 计算建议以调整实例大小吗

docker - gcloud docker无法在Compute Engine VM上运行

go - 如何从数据存储中获取名称/ key