MongoDB सर्वर को शटडाउन करना
MongoDB में शटडाउन कमांड चलाने के लिए आपको पहले admin डेटाबेस पर स्विच करना होगा।
सिंटैक्स
use admin
db.shutdownServer()
उदाहरण
> use admin
switched to db admin
> db.shutdownServer()
आउटपुट:
server should be down...
2019-04-22T19:11:40.949+0530 I NETWORK [js] trying reconnect to 127.0.0.1:27017 failed
2019-04-22T19:11:42.197+0530 I NETWORK [js] reconnect 127.0.0.1:27017 failed failed
महत्वपूर्ण: shutdownServer() कमांड केवल admin डेटाबेस से चलाया जा सकता है। यह सर्वर को ग्रेसफुली शटडाउन करता है।