我查询了 dynamo db,它返回了一个这样的字符串。
{ Item:
{ password:
{ S:
'$2a$10$..G.xCxVinjZQUGHxJF9a.6dSuChgOfPB0M1WjF4mrY5z7g4Gojae'
},
role: {
S: 'hr'
}
}
}
从这个字符串中,我想去掉不同变量中的密码和角色,我该怎么做?
发电机数据库查询是这样的。
var opts = {
'ConsistentRead': true,
'AttributesToGet': ['role', 'password'],
TableName : 'users',
Key : {
"userid" : {
"S" : usrname
}
}
};