获取 API 密钥
运行 $ 写

浮点数

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

移除收藏和其中的所有内容。 它可以告诉你有多少文档被保存。

document databasefreenot reversible
Using Python?

Switch any code block to Python: the choice applies to every page. Python SDK guide and resource reference.

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.

即使在仓库满满的时候也有效

喜欢 删除删除删除, 下调允许超过配额:这就是你如何腾出空间,所以拒绝它会留下一个无法清空的储存库。

特工会怎么处理它

最开放的模式是唯一一个 能够无缘无故通过它的模式

计划模式中,它被完全拒绝,在其它任何地方,它都被要求。如果你的代理人从不放弃任何东西,请在指示中说,并回答问题——只有钝器。