1

How does scan work with Set Attribute Type (NS or SS). I like to provide some condition for retrieve a Set. For eg: in Table I have

{Item1: Attr1{NS : 1,2,3,4,5}}
{Item2: Attr1{NS : 6,7,8}}
{item3: Attr1{NS : 7,10}}

I'd like to take the Item2 and Item3 by giving some scan condition. Can any one help me with this?

1 Answer 1

2

Use CONTAINS or NOT_CONTAINS as the ComparisonOperator of the ScanFilter (more info here: http://docs.amazonwebservices.com/amazondynamodb/latest/developerguide/API_Scan.html)

Eg:

{
  "TableName":"MyTable",
  "ScanFilter": {
    "Attr1": {
      "AttributeValueList": [{"N":"7"}],
      "ComparisonOperator": "CONTAINS"
    }
  }
}

This will return Item2 and Item3 because they both contain 7.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.