
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Shutdown MongoDB with Auth Enabled
To shutdown MongoDB, you need to use shutdownServer() as in the below syntax −
db.shutdownServer();
First you need to switch to admin as shown below −
use admin;
Here, we switched to admin −
> use admin; switched to db admin
Following is the query to shutdown server −
> db.shutdownServer();
This will produce the following output −
server should be down... 2020-01-07T22:40:31.295+0530 I NETWORK [js] trying reconnect to 127.0.0.1:27017 failed 2020-01-07T22:40:32.326+0530 I NETWORK [js] reconnect 127.0.0.1:27017 failed failed
Advertisements