With query
GTLQueryDrive *queryFilesList = [GTLQueryDrive queryForChildrenListWithFolderId:@"root"];
I get everything in root folder: files and folders. Sure, I can look for folder in GTLDriveChildList
returned. But root folder can have thousands items, and I need only one of them. I tried narrow search. Comments in GTLQueryDrive.h
say it's possible. I've tried queryFilesList.q = @"mimeType='application/vnd.google-apps.folder'";
to query only folders or queryFilesList.q = [NSString stringWithFormat:@"title='%@'", folderName];
to query all items by name. Both queries return empty lists. Double checked: folder I look for really exists.
I've tried
GTLQueryDrive *queryFilesList = [GTLQueryDrive queryForFilesList];
It works well with
queryFilesList.q = @"mimeType='audio/x-aiff'";
But returns empty list if I try to query only folders with
queryFilesList.q = @"mimeType='application/vnd.google-apps.folder'";
What am I doing wrong?
I am selfish idiot!
GTLQueryDrive *queryFilesList = [GTLQueryDrive queryForChildrenListWithFolderId:@"root"];
queryFilesList.q = @"mimeType='application/vnd.google-apps.folder'";
works just fine, but it sees ONLY folders created with this app! That was my problem. To be exact you may use this query:
queryFilesList.q = @"mimeType='application/vnd.google-apps.folder' and 'root' in parents and trashed=false";
trashed=false
is important if you don't want trashed items to be found.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With