Skip to content

Add maxItems to QueryEnhancedRequest to simplify pagination #6750

@iulianbudau

Description

@iulianbudau

Describe the feature

Add a direct method (e.g., maxItems() or limit()) to the QueryEnhancedRequest.Builder class in AWS SDK for Java v2 to control the maximum number of items returned in query results.

Use Case

Currently, developers must implement complex pagination logic using iterators and page size controls to limit result sets, which adds unnecessary complexity to simple use cases. This feature would provide functionality similar to the --max-items parameter available in the AWS CLI for DynamoDB queries.

Proposed Solution

No response

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

AWS Java SDK version used

2.41.34

JDK version used

21

Operating System and version

Windows 11 Enterprise

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions