After installing the MONGO database in the installation database of the drive letter, such as the C disk new folder called MONGOs such as C:\mongos
Open the first Small black window input Mongod-storageengine Mmapv1-dbpath C:\mongos This is the warehouse of the database
Open a second small black window input MONGO
See the admin.0 and local.0 appear in the C-drive MONGOs folder to indicate that they have been installed.
1. View the database
Show DBS------View the database
2, using and creating a database there is no right to create
Use students-----into the database
3, view collection (table)
Show Collections---View collections in the Database (table)
4, creating a collection (table)
Db. The set name is entered without creating a db.xuehao------Create a collection (table)
5, add a data Db.xuehao.insert ({"num": "20180809"})
Db. Collection. Insert ({})
6, important Import data (import multiple data) as the data is imported into the database it is created successfully inside the collection (table) also created successfully
First, CTRL c disconnects the database
Step two, create a new TXT file outside the content as follows: multiple data
For example: Create a new A.txt file in the D disk with the following contents:
{"src": "Http://127.0.0.1/image/c6.jpg"}
{"src": "Http://127.0.0.1/image/c8.jpg"}
{"src": "Http://127.0.0.1/image/c9.jpg"}
Third, in the case of ensuring that the database warehouse is open: Open the Data Warehouse mongod-storageengine Mmapv1-dbpath C:\mongos This is the repository of the database
And open a little black window. Input: Mongoimport--db shujukuming--collections biaoming--drop--file d:/a.txt
The upper d:/a.txt can be dragged directly to the small black window.
This creates a new database named Shujukuming (table) named Biaoming and imports the contents of the file inside the a.txt.
6,
View all data under collection-----db.xuehao.find ()
Db. Collection. Find ()
Node MongoDB database opens and operates