Google-api-nodejs-client: How to pass multiple parent ids in a File list query

Created on 26 Apr 2020  路  2Comments  路  Source: googleapis/google-api-nodejs-client

Currently, I'm getting the file names of a folder in nodejs API using below code,

service.files.list(
    {
      auth: auth,
      pageSize: 1000,

      q: "'folderid' in parents",
 fields: 'nextPageToken, files(id, name,parents)'})

Now I have requirement to do the check for multiple folder ids and is not able to figure out what is the right syntax to pass multiple folderids in the same query.
Something like this is not working,

service.files.list(
    {
      auth: auth,
      pageSize: 1000,

      q: "['folderid',folderid2'] in parents",
 fields: 'nextPageToken, files(id, name,parents)'})`
question

All 2 comments

Greetings! I don't have any inside knowledge, but looking at this page:
https://developers.google.com/drive/api/v3/search-files

It looks like you can use or in the q field. Have you tried something like:

q: "'folderid' in parents or 'filderid2' in parents"

works thanks!

Was this page helpful?
0 / 5 - 0 ratings