Skip to content

How to query List\Map Key-Value field #269

Answered by nelson6e65
fbramato asked this question in Q&A
Discussion options

You must be logged in to vote

I asked to Bing and got this answer (Scan):

This code allows you to get the documents with the documentNumber AF34325, filtering by the attribute of the metadata list.

{
  "TableName": "Documents",
  "FilterExpression": "contains (metadata, :documentNumber)",
  "ExpressionAttributeValues": {
    ":documentNumber": {"M": {"Key": {"S": "documentNumber"}, "Value": {"S": "AF34325"}}}
  }
}

You should add/use an index to use Query instead of Scan. Check if can help somehow 😅

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by nelson6e65
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #268 on March 10, 2023 13:24.