Reputation: 16764
I succeeded to manage my issue: List folders which has not a custom property in Google Drive API v3 and .NET
Now, I have other challenge.
I have custom property called imdb
and it has any value (not empty).
I tried to figure out how to retrieve those items which have imdb
property in list (no matter what value
have). I don't want getting entire full list and check one by one the Properties
dictionary (I have 300-320 items and is growing).
request.Q = $"mimeType='application/vnd.google-apps.folder' and properties has {{ key='imdb' and value='/*WHAT SHOULD DO ?*/' }}";
Seems that query works only if provide both components key
and value
, otherwise I will get 400 as well
I tried also:
request.Q = $"mimeType='application/vnd.google-apps.folder' and properties has {{ key='imdb' and value!='' }}";
but it gave me 400 (bad request), seems value!=''
is not valid
The request
object is:
var request = dataService.Files.List();
and
...
dataService = new DriveService(new BaseClientService.Initializer
{
HttpClientInitializer = credential,
ApplicationName = "XXXX"
});
Any advice ?
Upvotes: 2
Views: 607
Reputation: 26836
This issue is being investigated by Google.
As a consequence, you can not use the not
, contains
or other operators that would be helpful for your query.
All you can do (not particularly efficient) is to
fields
to files/properties
files/properties
is not emptyrequest.Q = $"'{id}' in parents and (properties has {{ key='xxx' and value='' }} or not properties has {{ key='xxx' and value='' }})";
I would recommend you to comment on the existing issue to remind Google that it still has not been implemented.
Upvotes: 1