Query params with DynamoDB Doc Client

292 views Asked by At

I am trying to write params for my DynamoDB Query. I am getting an error and I believe it is from this query.

let params = {
    TableName: tableName,
    KeyConditionExpression:
      '(TimeId = :timeId AND begins_with ( TypeKey , :typeKey)) AND (awayTeam = :teamName OR homeTeam = :teamName)',
    ExpressionAttributeValues: {
      ':timeId': `${year}-${week}`,
      ':typeKey': 'GA',
      ':teamName': teamName,
    },
};

ERROR MSG: Invalid operator used in KeyConditionExpression: OR

PK: TimeId
SK: TypeKey
attributes: awayTeam  |  homeTeam

Can someone let me know what I am doing wrong? year, week and teamName are all defined as path parameters.

0

There are 0 answers