title: How to access nested elements in DynamoDB with NodeJS and Conditional Expresions?
body: <p>I'm having issues trying to access elements that are nested within a DynamoDB table using conditional expressions. The code I am trying is as follows:</p>
  
  <pre><code>const params = {
  TableName: 'Games',
  Key: {
    id: gameID.id,
  },
  UpdateExpression: 'SET #players = list_append(#answers , :answer)',
  ConditionExpression: '#players CONTAINS :playerID',
  ExpressionAttributeNames: {
    '#players': 'Players',
    '#answers': 'answers',
  },
  ExpressionAttributeValues: {
    ':playerID': userID.id,
    ':answer': tempAnswerList,
  },
  ReturnValues: 'ALL_NEW',
  </code></pre>
  
  <p>This version for example raises the error:</p>
  
  <pre><code>Invalid ConditionExpression: Syntax error; token: "CONTAINS", near: "#players CONTAINS :playerID"
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/NrmsS.png" rel="nofollow noreferrer">Example DB Schema</a></p>
  
  <p>Is there a way to look through an array without knowing it's id? Just as a note I have looked for wildcards to use on #players as it is a list but I cannot see one in the docs.</p>
  
  <p>Thanks,
  Mark</p>