Scanning by nested properties seems to not work
See original GitHub issueHi.
If I run this by command line I get results:
aws dynamodb scan --table-name Person --filter-expression "address.countryCode = :value" --expression-attribute-values '{":value":{"S":"ES"}}' --endpoint-url http://localhost:8000
See that I’m searching by person.address.countryCode.
Ok, I have Person configured with @DynamoDBTable
and the address attribute with @DynamoDBDocument
. Then, in PersonRepository, I have:
@EnableScan List<Person> findByAddressCountryCode( @Param("addressCountryCode") String addressCountryCode);
But when I execute the method in JUnit, it doesn’t return anything. Debugging, I see that in DynamoDBScanExpression, only scanFilter attribute is used, and not expressionAttributeNames and expressionAttributeValues, like by command line. The thing is that I cannot see which request is sent to my local dynamodb server. Maybe it is sending the key/value [countryCode / ES] instead of [address.countryCode / ES]. I’m suspecting that because I see (debugging) that in ScanRequestMarshaller
, tableName
is set to Person and scanFilterMap
contains the field countryCode, which doesn’t correspond to Person but to Person.Address
Could anyone tell me if it is an already known problem or what I’m doing wrong?
NOTE: other JUnit methods that test other repository methods over Person works without problem. But always over basic attributes like Number or String.
Regards.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:7
- Comments:13 (3 by maintainers)
Top GitHub Comments
I would like to query using filter expressions too. Is there any update on this issue?
@derjust Do we have any update for this issue? I mean I am also facing the similar issue…I would like to query based on nested DynamoDB document and List of nested DynamoDB document. Any help would be really appreciated.