我插入一个实体:
datastore.save({
key: datastore.key(['Users', 'bob']),
method: 'insert',
data: [
{
name: 'email',
value: 'bob@gmail.com',
excludeFromIndexes: false
}
]
}, function(err) {
if (!err) {
console.log('insert was a success');
}else{
console.log(err);
}
});
然后我想通过电子邮件查询用户:
var query = datastore.createQuery('Users').filter('email', 'bob@gmail.com');
datastore.runInTransaction(function(transaction, done) {
transaction.runQuery(query, function(err, entities) {
if (!err) {
//insert another thing into the datastore here ...
}else{
console.log('err = ' + err);
transaction.rollback(done);
return;
}
});
});
但我收到错误:
全局查询不支持强一致性
我看到我无法修改文档中节点的一致性,所以我该如何查询?