this.comm.notifications.on('gotUsers', (data) => {
alert(JSON.stringify(data));
this.users = data.Items;
alert(this.users.length)
alert(this.users)
});
this.comm.getCrew(# of test channel);
getCrew(channel) {
var db = new AWS.DynamoDB.DocumentClient(awsConfig);
var params = {
TableName: "bav-comms-users",
/*FilterExpression: "#N = :name",
ProjectionExpression:"#N, #CH",
ExpressionAttributeNames:{
"#N": "Name",
"#CH": "Channels"
},
ExpressionAttributeValues:{
":name":{
S: "# of test channel"
}
},*/
FilterExpression: "#r <> :role AND contains(channels, :channel)",
//FilterExpression: "id <> :id AND #r <> :role AND channel = :channels",
ExpressionAttributeNames:{
"#r": "role"
},
ExpressionAttributeValues: {
":channel": parseInt(channel),
":role": "guest"
}
/*ExpressionAttributeValues: {
":id":0,
":role": "guest"
}*/
}
var getUsersQuery = db.scan(params).promise();
getUsersQuery.then(function(data) {
this.notifications.emit('gotUsers', data);
}.bind(this));
}
サンプルデータでコードを表示します。 – notionquest
\t this.comm.notifications.on('gotUsers', (data) => { \t \t \t alert(JSON.stringify(data)); \t \t \t this.users = data.Items; \t \t \t alert(this.users.length) \t \t \t alert(this.users) \t \t }); \t \t \t \t this.comm.getCrew(#of test channel);
–申し訳ありません –