jessedev:cleaner

v0.4.1Published 6 months ago

Jessedev1 Cleaner

Based on xolvio:cleaner

This package cleans your database for testing purposes.

Installation

meteor add jessedev:cleaner

Usage

resetDatabase only resets your database when it is executed inside a debugOnly environment.

You can clear your database with resetDatabase(options, callback). It works on both the client and the server.

1import { resetDatabase } from 'meteor/jessedev:cleaner';
2
3// delete all collections with optional callback
4resetDatabase(null, callback);

Provide specific database instance

1// delete all collections except myCollection with optional callback
2resetDatabase({db: yourDatabaseInstance}, callback);

Don't reset certain collection

1// delete all collections except myCollection with optional callback
2resetDatabase({excludedCollections: ['myCollection']}, callback);