1
votes

Hello I m new to DynamoDB, I have created a TABLE, with Partition Key "pk" and Sort Key "id"

in then item explorer I can query with the pk and sort key value and it seems to work.

In the PartiQL Editor I do

SELECT * FROM "dev" WHERE "pk" = 'config' AND "id" = "7b733512cc98445891dcb07dc4299ace"

and I get the error Filter Expression can only contain non-primary key attributes: Primary key attribute: id

I don't know how I can specify the sort key in the key conditions instead of the filter condition with the WHERE clause.

1

1 Answers

1
votes

I found the error, if you use " instead of ' it doesn't work. so the correct query is :

SELECT * FROM "dev" WHERE "pk" = 'config' AND "id" = '7b733512cc98445891dcb07dc4299ace'