1 Antwort
- Neueste
- Die meisten Stimmen
- Die meisten Kommentare
1
I would start by ensuring you are on the latest AWS SDK version for node V3. It works for me on v3.44.0
with no issue, only thing I needed to change was your ExpressionAttributeValues
as V3 takes native string and no DDB JSON.
query = {
TableName: 'RatingsTable',
IndexName: 'username',
KeyConditionExpression: '#username = :username',
ExpressionAttributeNames: {
'#username': 'username'
},
ExpressionAttributeValues: {
':username': username
},
ProjectionExpression: 'username, imdb_title_id'
};
console.log('query', query);
const result = await dbClient.send(new QueryCommand(query));
Relevanter Inhalt
- AWS OFFICIALAktualisiert vor 2 Jahren
- AWS OFFICIALAktualisiert vor einem Jahr
- AWS OFFICIALAktualisiert vor 2 Jahren
- AWS OFFICIALAktualisiert vor 2 Jahren
Without specifying the Data type for ExpressionAttributeValues, TypeScript throws this error:
Type 'string' is not assignable to type 'AttributeValue'
and CloudWatch gives this error,Cannot read property '0' of undefined
. I'll try downgrading to 3.44 as I'm using 3.54.1Edit: Downgrading and Specifying Data type solved this!