4

I'm working with Minio and graphql in NodeJS and I'd like to set up a dataloader for my minio resources.

I'm aware of the statObject function that lets me get the metadata of a resource by providing the bucket and name of the resource.

I'd like to be able to pass in multiple names and essentially get an array containing the metadata of the objects with the names I passed.

For example, something like:

const objectNames = ['a.txt', 'b.txt', 'c.txt'];

minioClient.statObjects('bucket', objectNames, (err, res) => {});

I haven't found anything like this in the documentation or when I was searching on the web. Does something like this exist?

1 Answer 1

2

I've made an issue on the JavaScript repository: https://github.com/minio/minio-js/issues/889 and got the following response.

SDK will still have to make a call individually and return the values. There is no S3 API that corresponds to this feature request. I think the application itself can handle this instead of the SDK.Closing this issue, please feel free to reach out to us if you feel otherwsie

Since there's no S3 API to do what I want to do I don't think that this is possible at the moment. There's one workaround I've devised for myself which is using my own database to store the metadata of a file. I can simply list all objects from the bucket and upload their metadata to my own database. Most databases support querying by an array of values so that will help avoid any N+1 issues.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.