I am using a local instance of MongoDB using the command mongo
. Using mongosh
, I created a couple of dbs and collections and insert some data.
After performing the required operations, I needed to shut down the server. Following the docs, I entered db.shutdownServer()
but get the error Error: read ECONNRESET
. I then tried using the alternative methods and used Control-C
in the terminal instance where the server was running. It shut down.
When I restarted the server to perform some operations, I could not find the dbs I created in the last session.
- Is this the intended behavior? If yes, how can I ensure cross-session data persistence?
- Was the session termination a clean shutdown in my case?
- How can I troubleshoot the error encountered while using
db.shutdownServer()
?