await storage.run({ action: "dropCollection", collection: "temp_import" });
// { ok: true, dropped: "temp_import", documents: 48211 }storage.run(action="dropCollection", collection="temp_import")
# {"ok": True, "dropped": "temp_import", "documents": 48211}فَقَدْ تَعَدُّ إِلَى ٱلْحَقِّ ، لَا يَنْبَغِي أَنْ يَتَعَلَّمَ ٱلْكِتَابُ ٱلْمُقَدَّسُ مِنْ مَسْؤُولِيَّةِ ٱلْمَسِيحِيِّينَ .
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 });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)جمع لا يوجد ما يُرفض
فبدلا من الاجابة عن السؤال « فعل » ، من اجل شيء لم يكن موجودا قط ، الذي يخفي خطأ مطبعي في اسم ، في الوقت المحدد ، يكون اهمية المطبعة في هذا الوقت .
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.
}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.يعمل حتى عندما يكون التخزين ممتلئاً
مثل تحذف عبارة،الإسقاط مسموح به بعد الحصة: هو كيف يمكنك جعل الغرفة، وبالتالي رفضه يترك مخزن لا يمكن تفريغه.
ما قد يفعله العميل به
في طريقة التخطيط يرفضه تماماً، وفي أي مكان آخر يطلبه، وإذا لم يكن على عميلك أن يسقط شيئاً، فقل ذلك في تعليماته، واجيب على السرعة - فالأسلوب وحده أداة غير حادة.