0

I am trying to query my dynamodb table for a specific partition_key in which the sort key begins with "REFRESHTOKEN_". I am using DocumentClient query operation for this. When ran, I get the following error message that the expression attribute :refreshTokenID is not defined when clearly it is. See below for what my query looks like.

 var queryParams = {
            TableName: 'security',
            KeyConditionExpression: 'partition_key=:refreshTokenID and begins_with(sort_key, :refreshTokenString)',
            ExpressionAttributeValues:{
                ':refreshTokenID': refreshToken.refreshTokenID,
                ':refreshTokenString': 'REFRESHTOKEN'
            }
        };

        var data = await dynamodb_driver.query('us-east-1', queryParams);
Justin Yapp
  • 89
  • 1
  • 6
  • 2
    Have you checked that 'refreshToken.refreshTokenID' is not null/undefined? – Matthew Pope Jul 24 '19 at 19:08
  • You are correct, the refreshTokenID was null and therefore the field ':refreshTokenID' was omitted altogether. Did not realize that was the behavior as I expected the null value to atleast be passed through. – Justin Yapp Jul 24 '19 at 21:02

0 Answers0