MongoDB drop every database

后端 未结 8 1011
清歌不尽
清歌不尽 2021-01-29 19:30

I would like to know if there\'re a command to drop every databases from my MongoDB?

I know if I want to drop only one datatable, I just need to type the name of the dat

8条回答
  •  走了就别回头了
    2021-01-29 19:45

    It is as easy as

    mongo --eval 'db.dropDatabase()'
    

    Or, you can start a mongo session on your terminal and write

    db.dropDatabase()
    

    Which is exactly the same.

提交回复
热议问题