Skip to content

Ability to apply filter expressions to Querys #27

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
boostchicken opened this issue May 24, 2020 · 3 comments · Fixed by #29
Closed

Ability to apply filter expressions to Querys #27

boostchicken opened this issue May 24, 2020 · 3 comments · Fixed by #29
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@boostchicken
Copy link
Owner

	@Query(fields = "leaveDate", limit = 1, filterExpression = "contains(#field, :value)",
			expressionMappingNames = {@ExpressionAttribute(key = "#field", value = "name")},
			expressionMappingValues = {@ExpressionAttribute(key=":value", value = "projection")})

This allows people the ability to use filter expressions

@boostchicken boostchicken self-assigned this May 24, 2020
@boostchicken boostchicken added the enhancement New feature or request label May 24, 2020
@boostchicken boostchicken changed the title Ability to apply filter expressions to Queryes Ability to apply filter expressions to Querys May 24, 2020
This was referenced May 24, 2020
@boostchicken
Copy link
Owner Author

Added #29

@boostchicken
Copy link
Owner Author

Released in 5.2.4

@boostchicken boostchicken linked a pull request May 25, 2020 that will close this issue
@boostchicken boostchicken modified the milestones: 5.2.3, 5.2.4 May 25, 2020
@adarshhm6
Copy link

@query(fields = "leaveDate", limit = 1, filterExpression = "contains(#field, :value)",
expressionMappingNames = {@ExpressionAttribute(key = "#field", value = "name")},
expressionMappingValues = {@ExpressionAttribute(key=":value", parameterName = "projection")})
List findByPostCode(@param("postCode") String postCode, @param("projection") String projection);

It allows filtering with dynamic parameters but what if the dynamic parameter passed is Non-String?
@ExpressionAttribute has 3 fields key, value and parameterName and all fields are of type String. Suppose I want to Query for Price >= 1000 where Price field in DynamoDB table is of Type Number. In cases of Boolean and Number fields how to filter the output.
AWS CLI has option to specify the type
{
":fn":{"S":"Amazon DynamoDB"},
":sub":{"S":"DynamoDB Thread 1"},
":num":{"N":"3"}
}
S for String, N for Number.
and whether filtering is supported for Collections like Price IN (100, 200).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants