ios - How to sort GTLQueryDrive items by folders first, name, size, date -
to items, this:
gtlquerydrive *query = [gtlquerydrive queryforfileslist]; query.q = [nsstring stringwithformat:@"'%@' in parents , trashed=false", folderid]; query.fields = @"files(mimetype, id, name, size, createdtime)"; [self.service executequery:query completionhandler:^(gtlserviceticket *ticket, gtldrivefilelist *files, nserror *error) { }];
but files , folders scattered , not sorted name. how without manually sorting?
thank answers.
based thread, can use orderby
query parameter has value of string
order documents list feed criteria or keys. valid keys createddate
, folder
, lastviewedbymedate
, modifiedbymedate
, modifieddate
, quotabytesused
, recency
, sharedwithmedate
, starred
, , title
. each key sorts ascending default, may reversed desc
modifier.
example usage: ?orderby=folder,modifieddate desc,title
. please note there current limitation users approximately 1 million files in requested sort order ignored.
you can check these related questions:
Comments
Post a Comment