As a kev user, I can use all condition and comparison types not just eq
Closed this issue · 4 comments
Conditions
'EQ'|'NE'|'IN'|'LE'|'LT'|'GE'|'GT'|'BETWEEN'|'NOT_NULL'|'NULL'|'CONTAINS'|'NOT_CONTAINS'|'BEGINS_WITH'
Some things should be clarified.
- Is "don't use
scan()
" rule still eligible for this issue? - it's allowed to use only 'EQ' condition for a primary/key field in
KeyCondiionExpression
. The second condition will work only for a sort key field.
To specify the search criteria, you use a key condition expression—a string that determines the items to be read from the table or index. You must specify the partition key name and value as an equality condition. You can optionally provide a second condition for the sort key (if present).
- There are conditions that can't be applied to a sort key, such as 'IN', 'NULL' and 'NOT_NULL'
list of supported conditions for primary key / Key Condition Expression - How to pass a condition name to the
filter()
method?
For example:
.filter({'city': 'Durham'}).filter({'name', 'S'}, 'begins_with')
- Summary:
We can apply 'EQ' for a primary key and 'EQ | LE | LT | GE | GT | BEGINS_WITH | BETWEEN' for a sort key with KeyConditionExpression
. and with FilterExpression
'EQ | NE | LE | LT | GE | GT | BEGINS_WITH | BETWEEN | EXSITS | NOT_EXISTS | IS_IN | CONTAINS | SIZE | ATTRIBUTE_TYPE' on all fields except key and sort fields.
Is there any progress in the matter? I need to make a filter by comparing if the value A == 'Y' and from B != 'Z'
Sadly no we another Kev sprint scheduled for 2 weeks from now
Since we have decided to split the backends into two different libraries kev (s3, s3/redis, and redis) and docb (dynamodb, cloudant, and faunadb). This ticket has been moved to docb.