当前位置:网站首页>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数据库当中。
连接成功后,点击界面左下角的加号+, 可以创建数据库



接下来就可以在图形化界面当中对数据库进行操作了
边栏推荐
- Using scrcpy projection
- 数据库锁表?别慌,本文教你如何解决
- Master the use of auto analyze in data warehouse
- CVPR 2022 | transfusion: Lidar camera fusion for 3D target detection with transformer
- 干货整理!ERP在制造业的发展趋势如何,看这一篇就够了
- [cloud native | kubernetes] in depth understanding of ingress (12)
- Use fail2ban to prevent password attempts
- 使用Scrcpy投屏
- SQL语言
- 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
猜你喜欢

Database lock table? Don't panic, this article teaches you how to solve it

Read the BGP agreement in 6 minutes.

n++也不靠谱

CA:用于移动端的高效坐标注意力机制 | CVPR 2021

Building intelligent gray-scale data system from 0 to 1: Taking vivo game center as an example

Transformer principle and code elaboration (tensorflow)

面试官:Redis 过期删除策略和内存淘汰策略有什么区别?
![[leetcode] 96 and 95 (how to calculate all legal BST)](/img/d5/788c88064bce6a7c4499017908b3f2.jpg)
[leetcode] 96 and 95 (how to calculate all legal BST)
提高MySQL深分页查询效率的三种方案

CA: efficient coordinate attention mechanism for mobile terminals | CVPR 2021
随机推荐
Interviewer: what is the difference between redis expiration deletion strategy and memory obsolescence strategy?
比量子化学方法快六个数量级,一种基于绝热状态的绝热人工神经网络方法,可加速对偶氮苯衍生物及此类分子的模拟
Can Console. Clear be used to only clear a line instead of whole console?
Etcd 存储,Watch 以及过期机制
Interviewer: what is the difference between redis expiration deletion strategy and memory obsolescence strategy?
干货整理!ERP在制造业的发展趋势如何,看这一篇就够了
Talk about the design and implementation logic of payment process
使用Scrcpy投屏
Agile development / agile testing experience
It is six orders of magnitude faster than the quantum chemical method. An adiabatic artificial neural network method based on adiabatic state can accelerate the simulation of dual nitrogen benzene der
请问大佬们有遇到这个情况吗,cdc 1.4 连接MySQL 5.7 无法使用 timestamp
CA: efficient coordinate attention mechanism for mobile terminals | CVPR 2021
iptables基础及Samba配置举例
Cann operator: using iterators to efficiently realize tensor data cutting and blocking processing
n++也不靠谱
老掉牙的 synchronized 锁优化,一次给你讲清楚!
PostgreSQL 9.1 飞升之路
[cloud native | kubernetes] in depth understanding of ingress (12)
二分查找的简单理解
七、软件包管理