1

根据Datastore文档,实体组的最大写入速率为每秒1次。根据Google云端数据存储中的实体组限制写入的内容

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

我想知道,如果这种情况下实现这一限制为单个或多个查询计数。

在堆栈溢出方面也有类似的问题 - 但他们似乎并没有证实你可以可以做什么。在你的实体

const datastore = require('@google-cloud/datastore')(); 

const key1 = datastore.key(['Users', 1, 'Comments']); 

const comment1 = { 
    userId: 1, 
    commentBody: '...', 
    ts: new Date(), 
}; 

const key2 = datastore.key(['Users', 2, 'Comments']); 

const comment2 = { 
    userId: 2, 
    commentBody: '...', 
    ts: new Date(), 
}; 

datastore.save({ 
    key: key1, 
    data: comment1 
}, (err) => { 
    // 
}); 

datastore.save({ 
    key: key2, 
    data: comment2 
}, (err) => { 
    // 
}); 

回答

0

看这里,你有2个实体组:

  1. 用户/ 1
  2. 用户/ 2

然后保存2个注释实体,一个在每个实体组。这被视为每个实体组写入1次。

+0

我曾经希望如此!谢谢丹 –

相关问题