amazon web services - DynamoDB scan error with ComparisonOperator CONTAINS in python -


i'm using pynamodb access dynamodb. work except scan comparison contains in setstring. code:

class dynamoentity(model):     class meta:         table_name = 'entity_record'          region = 'us-east-1'         read_capacity_units = 1         write_capacity_units = 1      doc_id = unicodeattribute(hash_key=true)     topics = unicodesetattribute(null=true)  def scan_by_topics(topics, **filters):     return dynamoentity.scan(topics__contains=topics, **filters)  _topics = ['aa', 'bb', 'cc', 'dd', 'ee']  _ in range(10):     add_record(random.choice(_topics) + '_id', topics=set([random.choice(_topics)]))  t in _topics:     query_by_topics(t) 

and got this:

one or more parameter values invalid: comparisonoperator contains not valid ss attributevalue type

i try in boto3 got same issue:

client = boto3.client('dynamodb')  response = client.scan(     tablename="entity_record",     scanfilter={"topics": {"comparisonoperator": "contains",                            "attributevaluelist": [{"ss": ["aa"]}]}},     returnconsumedcapacity="total" ) 

from this, accept contains:

if target attribute of comparison set ("ss", "ns", or "bs"), operator evaluates true if finds exact match member of set

i have found similar question case scan: link


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -