Google Drive API Files.List查询字符串-"not"操作员 [英] Google Drive API Files.List Query String - "not" operator
问题描述
类似于此问题 Google Drive API文件.列表查询字符串从某种意义上讲,我想了解setQ方法的所有语法:FileList files = drive.files().list().setQ("trashed = true").setMaxResults(100).execute();
Similar to this question Google Drive API Files.List Query String in the sense that I would like to know all the syntax for the setQ method: FileList files = drive.files().list() .setQ("trashed=true") .setMaxResults(100) .execute();
尤其是我想从查询中获取文件(而不是文件夹).
In particular I would like to get the files (not folders) from the query.
要获取文件夹,此查询将起作用:request.Q = "mimeType='application/vnd.google-apps.folder' and trashed=false "
To get folders this query works: request.Q = "mimeType='application/vnd.google-apps.folder' and trashed=false "
我尝试了不同的组合,例如
I have tried different combinations, like
request.Q = "not mimeType='application/vnd.google-apps.folder' and trashed=false "
request.Q = "mimeType!='application/vnd.google-apps.folder' and trashed=false "
等
有些运行但忽略了,有些只是崩溃.
Some run but ignore the not, some just crash.
是否可以获取仅文件列表?
Is there a way to get a list of only files?
推荐答案
Drive API查询语言目前没有否定词,对不起!这是我们应该添加的一项很棒的功能.
There are currently no negations in the Drive API query language, sorry! This is a great feature that we should be looking to add.
这篇关于Google Drive API Files.List查询字符串-"not"操作员的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!