excludeFromIndexes:[]不起作用。实体属性仍然被编入索引

问题描述 投票:0回答:1

我有一个事务,我正在保存一个实体,我有一个数组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});
            })
      }
node.js google-cloud-platform google-cloud-datastore
1个回答
2
投票

不同版本的Google Datastore库使用不同的语法,可能会完全忽略excludefromindex。

建议更新到最新版本。

© www.soinside.com 2019 - 2024. All rights reserved.