با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
برای جستجوی مجموعه خاصی از درایوهای مشترک، از فیلد query string q با drives.list استفاده کنید تا با ترکیب یک یا چند عبارت جستجو، درایوها را فیلتر کنید.
یک query string شامل سه بخش زیر است:
query_term operator values
کجا:
query_term عبارت یا فیلدی است که باید در آن جستجو کرد.
operator شرط را برای عبارت پرس و جو مشخص می کند.
values مقادیر خاصی هستند که می خواهید برای فیلتر کردن نتایج جستجوی خود استفاده کنید.
برای مشاهده عبارتهای جستجو و عملگرهایی که میتوانید برای فیلتر کردن درایوهای مشترک استفاده کنید، به عبارتها و عملگرهای درخواست جستجو مراجعه کنید.
به عنوان مثال، رشته جستجوی زیر جستجو را فیلتر می کند تا فقط درایوهای مشترک با نام «منابع API Google Drive» را برگرداند.
q: name = 'Google Drive API resources' & useDomainAdminAccess=false
نمونه های رشته پرس و جو
جدول زیر نمونه هایی از رشته های پرس و جوی اولیه را برای درایوهای مشترک فهرست می کند. کد واقعی بسته به کتابخانه مشتری که برای جستجوی خود استفاده می کنید متفاوت است.
همچنین باید از کاراکترهای خاص در نام فایل خود فرار کنید تا مطمئن شوید که پرس و جو به درستی کار می کند. به عنوان مثال، اگر نام فایلی دارای هر دو کاراکتر آپاستروف ( ' ) و بک اسلش ( "\" ) باشد، برای فرار از آنها از بک اسلش استفاده کنید: name contains 'quinn\'s paper\\essay' .
چیزی که می خواهید پرس و جو کنید
مثال
useDomainAdminAccess تنظیمات DomainAdminAccess
درایوهای مشترک ایجاد شده پس از ۱ ژوئن ۲۰۱۷
createdTime > '2017-06-01T12:00:00'
true
درایوهای مشترک در نمای پیش فرض قابل مشاهده است
hidden = false
false
درایوهای مشترک با بیش از یک عضو
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
درایوهای مشترکی که حاوی شناسه واحد سازمانی نیستند
orgUnitId != 'C03az79cb'
true
چند عبارت را با پرانتز جستجو کنید
می توانید از پرانتز برای گروه بندی چند عبارت پرس و جو با هم استفاده کنید. به عنوان مثال، برای جستجوی درایوهای مشترک ایجاد شده پس از یک تاریخ خاص و دارای بیش از پنج سازمان دهنده یا بیش از 20 عضو، از این عبارت استفاده کنید:
createdTime > '2019-01-01T12:00:00' and (organizerCount > 5 or
memberCount > 20)
این جستجو همه درایوهای مشترک ایجاد شده پس از 1 ژانویه 2019 و دارای بیش از پنج سازمان دهنده یا بیش از 20 عضو را برمی گرداند.
Drive API andor عملگرها را از چپ به راست ارزیابی میکند، بنابراین همان جستجوی بدون پرانتز برمیگردد:
فقط درایوهای مشترک با بیش از پنج سازماندهنده که پس از ۱ ژانویه ۲۰۱۹ ایجاد شدهاند.
همه درایوهای مشترک با بیش از 20 عضو، حتی آنهایی که قبل از 1 ژانویه 2019 ایجاد شده اند.
تاریخ آخرین بهروزرسانی 2025-08-29 بهوقت ساعت هماهنگ جهانی.
[[["درک آسان","easyToUnderstand","thumb-up"],["مشکلم را برطرف کرد","solvedMyProblem","thumb-up"],["غیره","otherUp","thumb-up"]],[["اطلاعاتی که نیاز دارم وجود ندارد","missingTheInformationINeed","thumb-down"],["بیشازحد پیچیده/ مراحل بسیار زیاد","tooComplicatedTooManySteps","thumb-down"],["قدیمی","outOfDate","thumb-down"],["مشکل ترجمه","translationIssue","thumb-down"],["مشکل کد / نمونهها","samplesCodeIssue","thumb-down"],["غیره","otherDown","thumb-down"]],["تاریخ آخرین بهروزرسانی 2025-08-29 بهوقت ساعت هماهنگ جهانی."],[],[],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)"]]