当前位置:网站首页>Node の MongoDB 安装
Node の MongoDB 安装
2022-07-04 12:42:00 【华为云】
MongoDB数据库
定义:MongoDB 是一个基于分布式文件存储的数据库。由 C++ 语言编写。旨在为 WEB 应用提供可扩展的高性能数据存储解决方案。
MongoDB 是一个介于关系数据库和非关系数据库之间的产品,是非关系数据库当中功能最丰富,最像关系数据库的。
安装地址:https://www.MongoDB.com/try/download/community

关系型数据库和非关系型数据库
说到MongoDB肯定要介绍一下关系型数据库和非关系型数据库。
关系型数据库最典型的数据结构是表,由二维表格模型及其之间的联系所组成的一个数据组织。
非关系型数据库严格上不是一种数据库,应该是一种数据结构化存储方法的集合,可以是文档或者键值对等。比如像,map一样的键值对关系。
非关系型数据库优点:
1、格式灵活:存储数据的格式可以是key,value形式、文档形式、图片形式等等,文档形式、图片形式等等,使用灵活,应用场景广泛,而关系型数据库则只支持基础类型。
2、速度快:nosql可以使用硬盘或者随机存储器作为载体,而关系型数据库只能使用硬盘;
3、高扩展性;
4、成本低:nosql数据库部署简单,基本都是开源软件。
缺点:
1、不提供sql支持,学习和使用成本较高;
2、无事务处理;
3、数据结构相对复杂,复杂查询方面稍欠。
PS:本次只是使用一下,前端人员对其的掌握要求没有后端高
MongoDB安装
在之前已经在官网上讲数据库msi下载下来了,接下来开始安装
- 根据提示安装,前两部选择next即可


- 然后可以使用
custom来自定义安装目录

- 接下来点击next安装即可




PS:在安装时有一个坑,如果你勾选了
Install MongoDB Compass,那么安装时会卡死,因为这是MongoDB提供的可视化界面,但是下载时会从国外下载。
MongoDB启动
此时,MongoDB已经安装完毕了,现在启动测试一下是否成功
在之前自定义的安装目录下,有一个bin文件夹,里面有mongod.exe文件,这个程序就是用来启动mongodb服务器的。
在想要存放数据的地方,创建一个文件夹,比如db,这里我

然后在之前的bin文件夹中,使用cmd打开面包,输入mongod --dbpath=/mongodb/Server/data/db

由于我们并没有指定mongodb服务的端口号,所以它启动在默认的27017窗口。
打开浏览器,范围地址http://127.0.0.1:27017/,可看到如下信息
It looks like you are trying to access MongoDB over HTTP on the native driver port.
MongoDB可视化界面
对于MongoDB数据库,如果一直在命令控制符界面中使用有些不太方便,可以使用navicat,也可以直接使用MongoDB提供的图形化界面Compass。
下载地址:https://www.MongoDB.com/try/download/compass?jmp=docs

Compass图形化界面基本下载后打开就能使用了


点击connect按钮,然后就会连接到本地27017数据库当中。
连接成功后,点击界面左下角的加号+, 可以创建数据库



接下来就可以在图形化界面当中对数据库进行操作了
边栏推荐
- After the game starts, you will be prompted to install HMS core. Click Cancel, and you will not be prompted to install HMS core again (initialization failure returns 907135003)
- Implementation mode and technical principle of MT4 cross platform merchandising system (API merchandising, EA merchandising, nj4x Merchandising)
- Runc hang causes the kubernetes node notready
- 聊聊支付流程的设计与实现逻辑
- [leetcode] 96 and 95 (how to calculate all legal BST)
- Apache服务器访问日志access.log设置
- 从0到1建设智能灰度数据体系:以vivo游戏中心为例
- 上汽大通MAXUS正式发布全新品牌“MIFA”,旗舰产品MIFA 9正式亮相!
- Backgroundworker usage example
- 使用 NSProxy 实现消息转发
猜你喜欢

ArcGIS uses grid processing tools for image clipping

A data person understands and deepens the domain model

C#/VB. Net to add text / image watermarks to PDF documents

CANN算子:利用迭代器高效实现Tensor数据切割分块处理

AI painting minimalist tutorial

Golang sets the small details of goproxy proxy proxy, which is applicable to go module download timeout and Alibaba cloud image go module download timeout

实时云交互如何助力教育行业发展

Detailed explanation of mt4api documentary and foreign exchange API documentary interfaces

CVPR 2022 | transfusion: Lidar camera fusion for 3D target detection with transformer

2022年中国移动阅读市场年度综合分析
随机推荐
[FAQ] summary of common causes and solutions of Huawei account service error 907135701
模块化笔记软件综合评测:Craft、Notion、FlowUs
Is there an elegant way to remove nulls while transforming a Collection using Guava?
Interviewer: what is the difference between redis expiration deletion strategy and memory obsolescence strategy?
Building intelligent gray-scale data system from 0 to 1: Taking vivo game center as an example
Building intelligent gray-scale data system from 0 to 1: Taking vivo game center as an example
BackgroundWorker用法示例
CTF competition problem solution STM32 reverse introduction
Read the BGP agreement in 6 minutes.
Rsyslog configuration and use tutorial
请问大佬们有遇到这个情况吗,cdc 1.4 连接MySQL 5.7 无法使用 timestamp
Interviewer: what is the difference between redis expiration deletion strategy and memory obsolescence strategy?
Practice: fabric user certificate revocation operation process
mysql三级分销代理关系存储
go-zero微服务实战系列(九、极致优化秒杀性能)
ASP.NET Core入门一
Alibaba cloud award winning experience: build a highly available system with polardb-x
众昂矿业:为保障萤石足量供应,开源节流势在必行
DGraph: 大规模动态图数据集
Go zero micro service practical series (IX. ultimate optimization of seckill performance)