derjust / spring-data-dynamodb

This module deals with enhanced support for a data access layer built on AWS DynamoDB.
https://derjust.github.io/spring-data-dynamodb/
Apache License 2.0
403 stars 141 forks source link

Secondary Local Index is performing Scan instead of Query #252

Open bragadanilo opened 5 years ago

bragadanilo commented 5 years ago

Expected Behavior

I've defined an attribute to have the local secondary index. The table was created manually using aws cli which I'm able to see the LSI created.

@DynamoDBAttribute(attributeName = "status") @DynamoDBIndexRangeKey(localSecondaryIndexName = "statusLocalIndex") public String getStatus() ...

Actual Behavior

When I perform a call in my repository using a list of items to be used in a filter, it's doing a scan operation, where I expect to be a query operation since It's using only indexed fields.

Repository method: Page<Order> findAllByOrderIdAndStatusIn(List<String> status) ..

-ps: orderId is the hash key

Specifications