Question - How do we create a database in MongoDB?
Answer -
When I want to create a database in MongoDB, I faced the following error:
:~$mongo
MongoDB shell version:1.65
Connecting to: test
Error: Could not connect to the server
Exception: connect failed
The solution to the above error:
- cd/var1/lib1/MongoDB
- We remove the mongod. lock from the folder
- Sudo start MongoDB
- Mongo