특정 공유 드라이브 집합을 검색하려면 하나 이상의 검색어를 결합하여 반환할 드라이브를 필터링하는 drives.list와 함께 q 필드를 사용하세요.
쿼리 문자열에는 다음 세 부분이 포함됩니다.
query_term operator values
각 항목의 의미는 다음과 같습니다.
query_term은 검색할 검색어 또는 필드입니다.
operator은 쿼리 용어의 조건을 지정합니다.
values는 검색 결과를 필터링하는 데 사용할 특정 값입니다.
공유 드라이브를 필터링하는 데 사용할 수 있는 검색어 및 연산자를 보려면 검색어 및 연산자를 참고하세요.
예를 들어 다음 쿼리 문자열은 검색을 필터링하여 이름이 'Google Drive API 리소스'인 공유 드라이브만 반환합니다.
q: name = 'Google Drive API resources' & useDomainAdminAccess=false
쿼리 문자열 예시
다음 표에는 공유 드라이브의 몇 가지 기본 쿼리 문자열의 예가 나와 있습니다. 실제 코드는 검색에 사용하는 클라이언트 라이브러리에 따라 다릅니다.
또한 쿼리가 올바르게 작동하도록 파일 이름의 특수 문자를 이스케이프해야 합니다. 예를 들어 파일 이름에 아포스트로피(')와 백슬래시("\") 문자가 모두 포함된 경우 백슬래시를 사용하여 이스케이프 처리합니다(name
contains 'quinn\'s paper\\essay').
쿼리할 내용
예
useDomainAdminAccess 설정
2017년 6월 1일 이후에 생성된 공유 드라이브
createdTime > '2017-06-01T12:00:00'
true
기본 뷰에 표시되는 공유 드라이브
hidden = false
false
멤버가 2명 이상인 공유 드라이브
memberCount > 1
true
제목에 '기밀'이라는 단어가 포함되고 회원이 20명 이상인 공유 드라이브
name contains 'confidential' and memberCount >= 20
true
조직의 모든 공유 드라이브 중 제목에 '기밀'이라는 단어가 포함된 공유 드라이브
name contains 'confidential' and orgUnitId = 'C03az79cb'
true
사용자가 회원으로 속한 모든 공유 드라이브 중에서 제목에 '기밀'이라는 단어가 포함된 공유 드라이브
name contains 'confidential'
false
할당된 주최자가 없는 공유 드라이브
organizerCount = 0
true
조직 단위 ID가 포함되지 않은 공유 드라이브
orgUnitId != 'C03az79cb'
true
괄호를 사용하여 여러 검색어 쿼리
괄호를 사용하여 여러 검색어를 함께 그룹화할 수 있습니다. 예를 들어 특정 날짜 이후에 생성되고 관리자가 5명 이상이거나 구성원이 20명 이상인 공유 드라이브를 검색하려면 다음 쿼리를 사용합니다.
createdTime > '2019-01-01T12:00:00' and (organizerCount > 5 or
memberCount > 20)
이 검색은 2019년 1월 1일 이후에 생성되었으며 관리자가 5명 이상이거나 구성원이 20명 이상인 모든 공유 드라이브를 반환합니다.
Drive API는 and 및 or 연산자를 왼쪽에서 오른쪽으로 평가하므로 괄호가 없는 동일한 검색은 다음을 반환합니다.
2019년 1월 1일 이후에 생성되었으며 주최자가 5명 이상인 공유 드라이브만 해당됩니다.
2019년 1월 1일 이전에 생성된 공유 드라이브를 포함하여 멤버가 20명을 초과하는 모든 공유 드라이브
[null,null,["최종 업데이트: 2025-08-29(UTC)"],[],[],null,["# Search for shared drives\n\nTo search for a specific set of shared drives, use the query string `q` field\nwith [`drives.list`](/workspace/drive/api/reference/rest/v3/drives/list) to filter the drives to\nreturn by combining one or more search terms.\n\nA query string contains the following three parts:\n\n*`query_term operator values`*\n\nWhere:\n\n- *`query_term`* is the query term or field to search upon.\n\n | **Note:** Most query terms require `useDomainAdminAccess=true`. For more information about this flag, see [`drives.list`](/workspace/drive/api/reference/rest/v3/drives/list).\n- *`operator`* specifies the condition for the query term.\n\n- *`values`* are the specific values you want to use to filter your search\n results.\n\nTo view the query terms and operators that you can use to filter shared drives,\nsee [Search query terms and operators](/workspace/drive/api/guides/ref-search-terms#drive-properties).\n\nFor example, the following query string filters the search to only return shared\ndrives with the name \"Google Drive API resources.\" \n\n q: name = 'Google Drive API resources' & useDomainAdminAccess=false\n\nQuery string examples\n---------------------\n\nThe following table lists examples of some basic query strings for shared\ndrives. The actual code differs depending on the client library you use for your\nsearch.\n\nYou must also escape special characters in your file names to make sure the\nquery works correctly. For example, if a filename contains both an apostrophe\n(`'`) and a backslash (`\"\\\"`) character, use a backslash to escape them: `name\ncontains 'quinn\\'s paper\\\\essay'`.\n| **Note:** These examples show the unencoded `q` parameter, where `organizerCount =\n| 0` is encoded as `organizerCount+%3d+0`. Client libraries handle this encoding automatically.\n\n| What you want to query | Example | `useDomainAdminAccess` setting |\n|--------------------------------------------------------------------------------------------------------------|------------------------------------------------------------|--------------------------------|\n| Shared drives created after June 1, 2017 | `createdTime \u003e '2017-06-01T12:00:00'` | `true` |\n| Shared drives visible in the default view | `hidden = false` | `false` |\n| Shared drives with more than one member | `memberCount \u003e 1` | `true` |\n| Shared drives with the word 'confidential' in the title and 20 or more members | `name contains 'confidential' and memberCount \u003e= 20` | `true` |\n| Shared drives with the word 'confidential' in the title among all shared drives of the organization | `name contains 'confidential' and orgUnitId = 'C03az79cb'` | `true` |\n| Shared drives with the word 'confidential' in the title among all shared drives that the user is a member of | `name contains 'confidential'` | `false` |\n| Shared drives with no assigned organizer | `organizerCount = 0` | `true` |\n| Shared drives that don't contain the organizational unit ID | `orgUnitId != 'C03az79cb'` | `true` |\n\nQuery multiple terms with parentheses\n-------------------------------------\n\nYou can use parentheses to group multiple query terms together. For example, to\nsearch for shared drives created after a specific date and that either have more\nthan five organizers or more than 20 members, use this query: \n\n createdTime \u003e '2019-01-01T12:00:00' and (organizerCount \u003e 5 or\n memberCount \u003e 20)\n\nThis search returns all shared drives created after January 1st, 2019 and that\nhave more than five organizers or more than 20 members.\n\nThe Drive API evaluates `and` and `or` operators from left to right,\nso the same search without parentheses would return:\n\n- Only shared drives with more than five organizers that were created after January 1st, 2019.\n- All shared drives with more than 20 members, even those created before January 1st, 2019.\n\nRelated topics\n--------------\n\n- [Search for files and folders](/workspace/drive/api/guides/search-files)\n- [Search query terms and operators](/workspace/drive/api/guides/ref-search-terms)"]]