Skip to content

Reset database (mockgoose.helper.reset(); equivalent) #452

Answered by hasezoey
ismail-codinglab asked this question in Q&A
Discussion options

You must be logged in to vote

here what can be done, in order (from 1 best to lowest) that should be done

  1. remove the database with the mongodb driver (or mongoose or anything else) [this should be preferred]
  2. use a different database in the connection string (like generate an name with something like uuidv4)
  3. restart the instance (only work if storageEngine is ephermeralForTest, for others the files need to be also cleaned) [this should be avoided, because it would slow down test]

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by hasezoey
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #451 on February 27, 2021 21:07.