问题
I have used User-Defined Metadata data to store the file in S3 bucket. Lets say my meta data would be like
metaData = {
"title": "some random user title",
"description": "some random user description"
}
I understand that i can download file using the object key and the bucket name. I am looking whether there any way/options to get/retrieve/list the file by passing only the bucket name and User-Defined Metadata used for the object to upload in S3.
And also to know the actual usage of User-Defined Metadata
Any guidance or suggestions would greatly helpful.!
回答1:
There is no native operation in Amazon S3 that can locate/retrieve objects via Metadata.
Metadata can be retrieved from objects, but cannot be used to search for objects. Also, only limited Metadata can be retrieved as part of an object listing.
An alternative would be to use Amazon S3 Inventory - Amazon Simple Storage Service. This only provides the listing once per day, but it can include metadata. You could use these files to locate objects based on metadata.
See:
- Amazon S3 : Listing Obejct with Metadata in single request
- Building and Maintaining an Amazon S3 Metadata Index without Servers | AWS Big Data Blog
来源:https://stackoverflow.com/questions/50174803/retrieve-list-objects-using-metadata-in-s3-aws-sdk