Skip to content

API reference ​

clear ​

Deletes all documents in a specified collection.

Parameters ​

PropTypeDescription
pathstringThe name of the collection to clear.

Returns ​

  • Returns a promise that resolves when the collection is cleared.

Example ​

js
await db.clear("users");
console.log(await db.getAll("users")); // Output: []

Released under the SSPL License.