link MogoDB service and import .bson file

when open the cmd panel, confirm the service of MongoDB has been started 

link to the database 

>>mongo   

get the name of database right now 

> db.getName()

display all the database  

> show dbs

open one databse  

use test_database 

>show collections 

> exit

扫描二维码关注公众号,回复: 4094343 查看本文章

leave mongo shell, import the .bson file  

>> mongorestore -d test_database C:\Mydata\test.bson


remove the database , in mongo shell:

>db.dropDatabase()










猜你喜欢

转载自blog.csdn.net/chenxin0215/article/details/80594118