Skip to content

Scanning by nested properties seems to not work #114

Open
@sasagonz

Description

@sasagonz

Hi.

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions