-
We want to list objects in a S3 bucket like this, client
.listObjects(
ListObjectsRequest {
bucket = bucketName
}
) But the Using the result client
.listObjects(
ListObjectsRequest {
bucket = bucketName
}
)
.contents?.mapNotNull { it.key }?.filter { it.contains(...) } Due to S3 Client BTW, how to do a pagination here, for example, count with same condition and query the result by page(or offset) and limit. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi, S3 does not support listing objects with a specific regex pattern, only prefix. To paginate, you can use |
Beta Was this translation helpful? Give feedback.
-
There is also a paginator for listObjectsV2Paginated that will handle the paging logic for you. See pagination in the developer guide for more info. |
Beta Was this translation helpful? Give feedback.
There is also a paginator for listObjectsV2Paginated that will handle the paging logic for you. See pagination in the developer guide for more info.