As I do not know how your code is, I'll leave a snippet of how you can do it.
As I said in my comment, just add the q
property and use one of the operators below followed by the value you want.
Operators:
-
contains
The content of one string is present in the other.
-
=
The contents of one string or boolean are the same as the other.
-
!=
The content of one string or boolean is not the same as the other.
-
<
The value is less than another.
-
<=
The value is less than or equal to another.
-
>
The value is greater than the other.
-
>=
The value is greater than or equal to another.
-
in
An element within a collection.
-
and
Returns items that match both clauses.
-
or
Returns items that match any clause.
-
not
Deny a search clause.
-
has
A collection contains an element that matches the parameters.
How to do:
"q": "<campo>" <operador> "<valor"> ["<campo>" <operador> "<valor"> ],
Example:
function listFiles() {
gapi.client.drive.files.list({
'pageSize': 10,
'q': "mimeType contains 'image/jpeg' or mimeType contains 'image/png'",
'fields': "nextPageToken, files(id, name)"
}).then(function(response) {
console.log('Files:');
let files = response.result.files;
if (files && files.length > 0) {
for (let i = 0; i < files.length; i++) {
let file = files[i];
console.log(file.name + ' (' + file.id + ')');
}
} else {
console.log('No files found.');
}
});
}