Closed olishevskii closed 1 month ago
Hi @olishevskii
That's probably because you don't have enough objects for the next page. By default, we return 1000
objects. If you do want to limit the number of objects returned, use maxResults
option and then you should be able to see nextPage
as well.
let [files, nextPage] = await bucket.getFiles({autoPaginate: false, maxResults: 10});
Hope this helps. I'm closing the issue now. Please feel free to re-open it if there's any other issue.
Hi @bajajneha27. Thank you for your answer.
Unfortunately, it's not working because there's a problem with the type.
Moreover, I have around 11,500 files in my bucket.
I see.
Well, I'm getting the nextPage
populated. Can you help me with a code snippet so that I can try to reproduce this?
@bajajneha27 no need to reproduce, the currently defined type is just a generic object. The issue is that it should be more clearly typed which is what @olishevskii is working on in the linked PR.
Why doesn't the second element of the array have the property pageToken? https://github.com/googleapis/nodejs-storage/blob/b4dbd73189b9fae4c23d614753670ee562bc717b/src/bucket.ts#L90
This property will be present if you pass
{ autoPaginate: false }
intoStorage.getFiles
.