I am trying to programmatically create a FilterExpression in Python for a DynamoDB query based on user provided parameter(s) for a specific Attribute (let's call it 'ATTRIBUTE1').
All user provided parameters which I need to filter for are in a list. For example: ['Parameter1', 'Parameter2']
Which would then take the form Attr('ATTRIBUTE1').eq(PARAMETER1)&Attr.('ATTRIBUTE1').eq(PARAMETER2)
How can I programmatically create an Attr for my FilterExpression like the above which is based on a changing number of user provided parameter(s)?
Sometimes I might have ['Parameter1'] and another time I might have ['Parameter1', 'Parameter2', 'Parameter3'] which need to turn into Attr('ATTRIBUTE1').eq('Parameter1') and Attr('ATTRIBUTE1').eq('Parameter1')&Attr('ATTRIBUTE1').eq('Parameter2')&Attr('ATTRIBUTE1').eq('Parameter3'), respectively.
I haven't been able to find a solution for this yet and would appreciate any guidance. Thanks in advance.