当前位置:网站首页>Node mongodb installation

Node mongodb installation

2022-07-04 13:42:00 Hua Weiyun

MongoDB database

Definition :MongoDB Is a database based on distributed file storage . from C++ Language writing . For the purpose of WEB Applications provide scalable, high-performance data storage solutions .
MongoDB Is a product between relational and non-relational databases , Non-relational databases are the most versatile , Most like a relational database .

Installation address :https://www.MongoDB.com/try/download/community

Relational database and non relational database

Speaking of MongoDB We must introduce relational database and non relational database .

The most typical data structure of relational database is table , A data organization consisting of two-dimensional tabular models and their connections .

A non relational database is not strictly a database , It should be a collection of data structured storage methods , It can be document or key value equivalence . Such as ,map The same key value pair relationship .

Advantages of non relational database :
1、 Flexible format : The format for storing data can be key,value form 、 Document form 、 Picture form and so on , Document form 、 Picture form and so on , Flexible use , Wide application scenarios , Relational databases only support basic types .
2、 Fast :nosql You can use hard disk or ram as a carrier , The relational database can only use hard disk ;
3、 High scalability ;
4、 The cost is low :nosql Database deployment is simple , It's basically open source software .

shortcoming :
1、 Does not provide sql Support , The cost of learning and using is high ;
2、 No transactions ;
3、 The data structure is relatively complex , It's a little bit less in terms of complex queries .

PS: This time it's just for use , The front-end personnel have less requirements for their mastery than the back-end

MongoDB install

Database has been mentioned on the official website before msi Download it , Next, start installing

  1. Install as prompted , The first two choices next that will do

  1. And then you can use custom Customize the installation directory

  1. Next click next Can be installed

PS: There is a pit during installation , If you check Install MongoDB Compass, Then it will jam during installation , Because this is MongoDB The visual interface provided , But when downloading, it will be downloaded from abroad .

MongoDB start-up

here ,MongoDB It's already installed , Now start to test whether it is successful

In the previously customized installation directory , There is one bin Folder , There are mongod.exe file , This program is used to start mongodb Server's .

Where you want to store data , Create a folder , such as db, Here I am

And then in the previous bin In the folder , Use cmd Open the bread , Input mongod --dbpath=/mongodb/Server/data/db

Because we didn't specify mongodb The port number of the service , So it starts by default 27017 window .

Open the browser , Range address http://127.0.0.1:27017/, You can see the following information

It looks like you are trying to access MongoDB over HTTP on the native driver port.


MongoDB Visual interface

about MongoDB database , It's inconvenient to use it in the command controller interface all the time , have access to navicat, It can also be used directly MongoDB Provide a graphical interface Compass.

Download address :https://www.MongoDB.com/try/download/compass?jmp=docs

Compass The graphical interface can be used after it is basically downloaded and opened

Click on connect Button , Then it will connect to the local 27017 In the database .

After successful connection , Click the plus sign in the lower left corner of the interface +, You can create a database

Next, you can operate the database in the graphical interface

原网站

版权声明
本文为[Hua Weiyun]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/185/202207041155516734.html