question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Scanning by nested properties seems to not work

See original GitHub issue

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.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:7
  • Comments:13 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
varshavenkat93commented, May 15, 2019

I would like to query using filter expressions too. Is there any update on this issue?

2reactions
VelDevelopercommented, Apr 20, 2019

@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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

DyanamoDB SCAN with nested attribute - Stack Overflow
To scan by a nested attribute, you should use ExpressionAttributeNames parameter to pass each path component (i.e. order and shortCode) ...
Read more >
Specifying item attributes when using expressions
This section describes how to refer to item attributes in an expression in Amazon DynamoDB. You can work with any attribute, even if...
Read more >
Authoring Tasks - Gradle User Manual
This means that changes which only touch the implementation of classes do not make the task out of date. Nested inputs. When analyzing...
Read more >
Why is my index not being used in this nested query?
When I EXPLAIN the query, I see that it is using a Seq Scan where I expected it to use the index I...
Read more >
ElasticSearch Nested Queries: How to Search for Embedded ...
This can happen when, for example, you have a nested JSON document, i.e., one JSON document inside another. This is because Lucene (i.e., ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found