Can't open mongo shell in GoormIDE

When I run mongod --dbpath data database running…

But when I try to open the mongo shell using mongo to make changes inside the database, it’s not working.

root@goorm:/workspace# mongo
MongoDB shell version v4.0.22
connecting to: mongodb://
2021-03-08T17:13:30.902+0000 E QUERY    [js] Error: couldn't connect to server, connection attempt failed: SocketExcepti
on: Error connecting to :: caused by :: Connection refused :
exception: connect failed

Please let me know where I’m making mistakes.

Okay, it was my fault :neutral_face:
Here is how I fix.
Open terminal and use this command(Remember about Note) ,
mongod --dbpath data
Run the app.js file from project’s directory
For me it was, node app.js
Use mongo command from the up above directory of data,

There should have a directory named data from where you are calling mongo. In my case, data is a directory inside workspace. So, in workspace, I used mongo command.

(1) We are in the workspace.
(2) We have data directory inside the workspace.
(3)After that, we use the mongo command from workspace directory.

That’s it.
Helpful Article,