Skip to content

Commit

Permalink
docs(faq): update "Do testing database paths get cleaned up?"
Browse files Browse the repository at this point in the history
  • Loading branch information
hasezoey committed Apr 11, 2022
1 parent 8c0afc0 commit d8e1ccc
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions docs/guides/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,11 @@ It is currently recommended to directly look at the TSDoc for these properties t

### Do testing database paths get cleaned up?

If the Database if a temporary directory (generated with `tmp`), then it will automatically get cleaned-up when calling `.stop()`, this can be disabled with `.stop(false)`.
If the Database if manually set (set with `dbPath`), then it needs to be manually cleaned-up with `.cleanup(true)`.
If the Database-path is a temporary directory (generated with `tmp`), then it will automatically get cleaned-up when calling `.stop()`, this can be disabled with `.stop(false)`.
If the Database-path is manually set with `dbPath`, then it needs to be manually cleaned-up with `.cleanup(true)`.

:::tip
Since `8.4.0` objects can also be used instead of just booleans for parameter in [`stop`](../api/classes/mongo-memory-server.md#stop) and [`cleanup`](../api/classes/mongo-memory-server.md#cleanup) (the same applies to `MongoMemoryReplSet`).

For Example `.stop({ doCleanup: false })` can be used instead of `.stop(false)`.
:::

0 comments on commit d8e1ccc

Please sign in to comment.