Does the ListBucket command guarantee the results are sorted by key?

半腔热情 提交于 2021-02-18 08:52:49

问题


When calling the S3 ListBucket command (via either REST or SOAP API), is the result set returned in any particular order? I would expect, given the nature of object keys and markers, that the result set is always sorted by object key. But I haven't seen any documentation confirming this.


回答1:


Update: Amazon has changed their documentation as shown below.

They are returned alphabetically. List results are always returned in UTF-8 binary order. See http://docs.aws.amazon.com/AmazonS3/latest/dev/ListingKeysUsingAPIs.html

Amazon S3 exposes a list operation that lets you enumerate the keys contained in a bucket. Keys are selected for listing by bucket and prefix. For example, consider a bucket named 'dictionary' that contains a key for every English word. You might make a call to list all the keys in that bucket that start with the letter "q". List results are always returned in lexicographic (alphabetical) order List results are always returned in UTF-8 binary order.



来源:https://stackoverflow.com/questions/4102115/does-the-listbucket-command-guarantee-the-results-are-sorted-by-key

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!