2 Answers
- Newest
- Most votes
- Most comments
1
Your expression should look like the following:
"FilterExpression": "#Scope = :Global",
"ExpressionAttributeValues": {
":Global": {
"S": "Global"
}
},
"ExpressionAttributeNames": {
"#Scope": "Scope"
}
However, its important to not how in-efficient your Scan
is. Its not scalable, and as a result will become expensive and slow over time. It would be much more efficient to create a Global Secondary Index for Scope
which will allow you to use a Query
which is more efficient in both performance and cost over Scan
.
There's an echo in here! ;)
Thank you, I completely missed that I mistakenly included the data type for ExpressionAttributeNames
1
I'm way out of practice with filter expressions but I think it should be something like:
"FilterExpression": "#Scope = :Global",
"ExpressionAttributeValues": {
":Global": {
"S": "Global"
}
},
"ExpressionAttributeNames": {
"#Scope": "Scope"
}
Relevant content
- asked 4 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 4 months ago
- AWS OFFICIALUpdated 3 months ago
- AWS OFFICIALUpdated 2 years ago
Your output with the 4 items looks incomplete - there are more "}" than "{". Were bits removed? Hard to see what's going on.
Oh shoot, that was an editing error. I have a Partner name field, which I cannot expose so when I pulled that out I mistakenly removed the leading opening "{". I just edited the question and made sure the response json is valid now. Sorry for the confusion.