List request page size being ignored

前端 未结 3 1033
[愿得一人]
[愿得一人] 2021-01-20 09:52

I\'ve been working with the drive SDK for the last few days and previously I was able to request 1000 items on a page using listrequest. Now I\'m only getting 100 files no m

相关标签:
3条回答
  • 2021-01-20 10:04

    Ok never mind I figured this out. I was requesting all the metadata of each file, which seems to limit the request to 100. I was able to get 1000 per page by requesting only three fields.

    EDIT by pinoyyid: This is not the answer. There is nothing that you can do to guarantee that the page will have exactly pageSize items.

    0 讨论(0)
  • 2021-01-20 10:05

    I'm facing the same problem so I've been doing some tests and this is what I've found:

    • If I try files.list with fields: "files, nextPageToken", I get 100 files only.
    • If I try files.list with fields: "files(name, id, etc, parents), nextPageToken", I get 460 files.
    • If I try files.list with fields: "files(name, id, etc), nextPageToken" without parents field, I get 1000 files.
    • If I try files.list with fields: "files(parents), nextPageToken", I get 460 files.

    So it seems that depends on how many fields you request and also if one of the fields requested is parents field.

    0 讨论(0)
  • 2021-01-20 10:25

    You've misunderstood what pagesize does. It is a maximum value, not an absolute value. You should always iterate list results until nextPageToken is null.

    0 讨论(0)
提交回复
热议问题