I am using Google Drive V3 API to manipulate files in a folder.
What I am currently doing to list all my files is like so:
const data = await drive.files.list({ q: `'${folderId}' in parents` });
console.log(data.files);
So basically I'm using a service account to query a folder for all its files. I'd also like to query for date. Something like createdTime < ${date}
.
Reading through a few posts on this site and the documentation, there doesn't seem to be such a feature to do so. I can see that there is the option to use modifiedTime
, however when I try to use it, everything just freezes up and the script run indefinitely.
Does anyone have any ideas as to how I can query this?
Edit 21/10/12 11:08
So I tried doing the following per Taneike's suggestion:
console.log('1') //this logs in the console
const data = drive.files.list({
q: `'${folderId}' in parents and createdTime > 2012-06-04T12:00:00-08:00`,
});
//unreachable code below
console.log('2') //this doesn't log
console.log(data) //this doesn't log
So basically my script will run indefinitely, and I have to manually end the script. drive.files.list
won't return anything.