# C

Canonical URL: https://developers.iagenify.com/ar/sdk/ref/connected-storage/run-write/drop-collection/
Language: ar

`storage.run({ action: "dropCollection", collection })`

يزيل a و الكل بوصة الإيطالية يُخبرُك كم عدد الوثائق.

Status: document database · free · not reversible

```javascript
await storage.run({ action: "dropCollection", collection: "temp_import" });
// { ok: true, dropped: "temp_import", documents: 48211 }
```

> **كم عدد الوثائق التي دمرتها**
>
> فَقَدْ تَعَدُّ إِلَى ٱلْحَقِّ ، لَا يَنْبَغِي أَنْ يَتَعَلَّمَ ٱلْكِتَابُ ٱلْمُقَدَّسُ مِنْ مَسْؤُولِيَّةِ ٱلْمَسِيحِيِّينَ .

```javascript
const { count } = await storage.run({ action: "count", collection });
if (count > 0) throw new Error(`${collection} still holds ${count} documents`);

await storage.run({ action: "dropCollection", collection });
```

## جمع لا يوجد ما يُرفض {#missing}

فبدلا من الاجابة عن السؤال « فعل » ، من اجل شيء لم يكن موجودا قط ، الذي يخفي خطأ مطبعي في اسم ، في الوقت المحدد ، يكون اهمية المطبعة في هذا الوقت .

```javascript
const existing = await storage.run({ action: "collections" });
if (!existing.some((c) => c.name === collection)) {
  // Nothing to drop. A misspelling here would otherwise look like success.
}
```

## يعمل حتى عندما يكون التخزين ممتلئاً {#quota}

مثل [تحذف عبارة](/ar/sdk/ref/connected-storage/run-write/delete)،الإسقاط مسموح به بعد الحصة: هو كيف يمكنك جعل الغرفة، وبالتالي رفضه يترك مخزن لا يمكن تفريغه.

## ما قد يفعله العميل به {#agent}

> **الـ أكثر فتحاً هو الوحيد الذي يسمح بهذا عبر غير قاب**
>
> في طريقة التخطيط يرفضه تماماً، وفي أي مكان آخر يطلبه، وإذا لم يكن على عميلك أن يسقط شيئاً، فقل ذلك في تعليماته، واجيب على السرعة - فالأسلوب وحده أداة غير حادة.

- [مخزن من طراز Name](/ar/sdk/agent/permissions/categories/storage): "سي سي Qu'un mood laisse traper" "و"سي com'il compite."
- [run()](/ar/sdk/ref/connected-storage/run): إلى حد ما أفعال، مثل garede-fuus و se que chacune coamte.

```python
storage.run(action="dropCollection", collection="temp_import")
# {"ok": True, "dropped": "temp_import", "documents": 48211}
```

```python
count = storage.run(action="count", collection=collection)["count"]
if count > 0:
    raise RuntimeError(f"{collection} still holds {count} documents")

storage.run(action="dropCollection", collection=collection)
```

```python
existing = storage.run(action="collections")
if not any(c["name"] == collection for c in existing):
    pass  # Nothing to drop. A misspelling here would otherwise look like success.
```
