Skip to content
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

FilterExpression in query #5

Open
obazoud opened this issue Jun 10, 2024 · 3 comments
Open

FilterExpression in query #5

obazoud opened this issue Jun 10, 2024 · 3 comments

Comments

@obazoud
Copy link

obazoud commented Jun 10, 2024

Hello,

Is there a way to add an FilterExpression when I query a dynamodb table ?

Thanks

@mikebroberts
Copy link
Member

Hi @obazoud - sorry, I missed this question. No, there isn't. DynamoDB filters are only executed client side (not cloud side) and in my experience it's easier to use regular code (e.g. a .filter()) on the query / scan result, rather than use DDB filters. To my knowledge there's no performance drawback in doing so.

@obazoud
Copy link
Author

obazoud commented Jan 13, 2025

In Amazon DynamoDB, filter expressions are executed server-side after retrieving the items that match the query criteria but before the results are returned to the client. This means that filters reduce the number of items returned but do not affect the number of read capacity units consumed, as all items matching the query criteria are initially read.

@mikebroberts
Copy link
Member

Hi @obazoud - OK, you made me go and read up, and you're correct. :) However filter expressions do still have enough limitations that I'm not sure I've ever used them.

I haven't heard of many people using this library, so I don't feel strongly about putting more work in to add this. However if I were to add it I'd probably extend the various Advanced...Options for queries and scans and allow the developer just to specify the precise filter expression that is passed through.

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

No branches or pull requests

2 participants