我有一个事务,我正在保存一个实体,我有一个数组excludesFromIndexes。当实体被保存时,它显示属性为索引,即使我添加了excludefromindexes。
function test(user,pass,array,callback){
let transaction = ds.transaction();
let key = ds.key('questions')
transaction.run()
.then(()=>
transaction.save(
{key: key,
data:{
'user':user,
'pass':pass
},
excludeFromIndexes:['user','pass']}))
.then(()=> transaction.commit())
.then(function(apiResponse){
callback({response:'successful'});
})
.catch(function(err){
transaction.rollback()
callback({'error':err});
})
}
不同版本的Google Datastore库使用不同的语法,可能会完全忽略excludefromindex。
建议更新到最新版本。