Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

References

Re-exports MongoCleanerCleanError
Re-exports MongoCleanerConnectionError
Re-exports MongoCleanerConnectionOptions
Re-exports MongoCleanerDisconnectionError
Re-exports MongoCleanerError
Re-exports MongoCleanerListCollectionsError
Re-exports MongoCleanerListDatabasesError
Re-exports MongoCleanerOptions

Functions

  • clean(uri?: string, connectionOptions?: MongoClientOptions, options?: Required<MongoCleanerOptions>): Promise<void>
  • Tries to remove all the database of MongoDB.

    Parameters

    • Optional uri: string

      The string uri of the mongodb connection. Default: mongodb://localhost:27017

    • Optional connectionOptions: MongoClientOptions

      The options for the connection. This function uses the npm module mongodb under the hood, so these are the MongoClientOptions. By default, if not explicitly set to false, "useUnifiedTopology" and "useNewUrlParser" are set to true.

    • Optional options: Required<MongoCleanerOptions>

      The options for the cleaner. You can specify things such as asking a confirm before cleaning, databases to be kept, keeping collections and removing their documents.

    Returns Promise<void>

Generated using TypeDoc