🔬
Moonlight.DB
GitHubNPM
  • Introduction
  • Getting Started
  • Documentation
    • Database
      • createCollection()
      • deleteCollection()
      • collections
    • Collection
      • find()
      • findOne()
      • update()
      • updateOne()
      • insertOne()
      • insertMany()
      • delete()
      • deleteOne()
      • length
Powered by GitBook
On this page
  • Example
  • deleteCollection(name)

Was this helpful?

  1. Documentation
  2. Database

deleteCollection()

Deletes a collection, including all items and indexes

PreviouscreateCollection()Nextcollections

Last updated 2 years ago

Was this helpful?

Example

db.deleteCollection("users").then(() => {
    console.log("deleteCollection:", "ok");
}).catch((error) => {
    console.log("error:", error);
});

deleteCollection(name)

Parameter
Description

name

The name for the collection

String