当前位置: 首页 > news >正文

简述建设一个商务网站的过程新东方厨师学费价目表

简述建设一个商务网站的过程,新东方厨师学费价目表,安徽省建筑业信息一体化平台网,做游戏直播那个网站好Ubuntu22.04 安装Mongodb6.X 1、Mongodb简介 1.1 什么是MongoDB? Mongodb是一个跨平台的面向文档的NoSQL数据库。它使用带有可选模式的类似JSON的BSON来存储数据。应用程序可以以JSON格式检索信息。 1.2 MongoDB的优点 可以快速开发web型应用,因为灵活,…

Ubuntu22.04 安装Mongodb6.X

1、Mongodb简介

1.1 什么是MongoDB?

Mongodb是一个跨平台的面向文档的NoSQL数据库。它使用带有可选模式的类似JSON的BSON来存储数据。应用程序可以以JSON格式检索信息。

1.2 MongoDB的优点

  • 可以快速开发web型应用,因为灵活,不用像关系型数据库一样需要建表
  • MongoDB存储的是文档(document),文档内存储的是类似json的结构,所谓json就是字符串数组

1.3 MongoDB的数据库分类

  • 数据库(database):用来存储集合的,而且数据库也有分大小
  • 集合(collection):集合类似于数组,用于存放文档的
  • 文档(document):文档是MongoDB数据库中最小的单位

image.png-169.6kB

MongoDB关系: 数据库(database) > 集合(collection)> 文档(document)

2、安装mongodb

2.1 导入MongoDB6.0版的公钥

root@Mongodb:~# curl -fsSL https://www.mongodb.org/static/pgp/server-6.0.asc | sudo apt-key add -

2.2 更新apt资源库

root@Mongodb:~# apt update

2.3 创建列表文件

root@Mongodb:~# echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/6.0 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-6.0.listroot@Mongodb:~# apt update

2.4 安装MongoDB的依赖libssl1.1

root@Mongodb:~# curl -LO http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1-1ubuntu2.1~18.04.21_amd64.debroot@Mongodb:~# dpkg -i libssl1.1_1.1.1-1ubuntu2.1~18.04.21_amd64.deb

2.5 安装mongodb

root@Mongodb:~# apt-get install -y mongodb-org

3、启动MongoDB服务

#启动MongoDB服务
root@Mongodb:~# systemctl start mongod#检查MongoDB服务状态
root@Mongodb:~# systemctl status mongod |grep activeActive: active (running) since Tue 2023-02-21 16:54:50 CST; 10s ago#设置服务开机自启动
root@Mongodb:~# systemctl enable mongod

4、MongoDB的使用

4.1 进入MongoDB

因为版本是6.0,所以需要在终端输入mongosh,该命令相当于6.0版本之前的mongo命令

root@Mongodb:~# mongosh
Current Mongosh Log ID:	63f48e2e5d50ed0f2ed35d3c
Connecting to:		mongodb://127.0.0.1:27017/?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+1.7.1
Using MongoDB:		6.0.4
Using Mongosh:		1.7.1For mongosh info see: https://docs.mongodb.com/mongodb-shell/To help improve our products, anonymous usage data is collected and sent to MongoDB periodically (https://www.mongodb.com/legal/privacy-policy).
You can opt-out by running the disableTelemetry() command.------The server generated these startup warnings when booting2023-02-21T16:54:50.226+08:00: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine. See http://dochub.mongodb.org/core/prodnotes-filesystem2023-02-21T16:54:50.700+08:00: Access control is not enabled for the database. Read and write access to data and configuration is unrestricted2023-02-21T16:54:50.700+08:00: vm.max_map_count is too low
------------Enable MongoDB's free cloud-based monitoring service, which will then receive and displaymetrics about your deployment (disk utilization, CPU, operation statistics, etc).The monitoring data will be available on a MongoDB website with a unique URL accessible to youand anyone you share the URL with. MongoDB may use this information to make productimprovements and to suggest MongoDB products and deployment options to you.To enable free monitoring, run the following command: db.enableFreeMonitoring()To permanently disable this reminder, run the following command: db.disableFreeMonitoring()
------test>

4.2 查看MongoDB数据库中的所有数据库

test> show dbs
admin   40.00 KiB
config  12.00 KiB
local   40.00 KiB

4.3 打开或者新建一个数据库

MongoDB不需要预先创建文档,在使用时自动创建

test> use fib
switched to db fib
fib>

4.4 添加集合

集合相当于mysql数据库中的表

fib> db.createCollection('teacher')
{ ok: 1 }
fib> show collections
teacher

4.5 插入数据

fib> db.teacher.insert({_id:1,sname:'张三',sage:20})
DeprecationWarning: Collection.insert() is deprecated. Use insertOne, insertMany, or bulkWrite.
{ acknowledged: true, insertedIds: { '0': 1 } }

4.6 查询所有记录

fib> db.teacher.find()
[ { _id: 1, sname: '张三', sage: 20 } ]

4.7 更新操作

fib> db.teacher.update({_id:1},{$set:{sname:'李四'}})
DeprecationWarning: Collection.update() is deprecated. Use updateOne, updateMany, or bulkWrite.
{acknowledged: true,insertedId: null,matchedCount: 1,modifiedCount: 1,upsertedCount: 0
}

4.8 查询

4.8.1 查询sname='李四'的记录

fib> db.teacher.find({sname:'李四'})
[ { _id: 1, sname: '李四', sage: 20 } ]

4.8.2 查询指定列sname数据

fib> db.teacher.find({},{sname:1})
[ { _id: 1, sname: '李四' } ]

4.8.3 AND条件查询

fib> db.teacher.find({sname:'李四',sage:20})
[ { _id: 1, sname: '李四', sage: 20 } ]

4.8.4 OR条件查询

fib> db.teacher.find({$or:[{sage:20},{sage:21}]})
[ { _id: 1, sname: '李四', sage: 20 } ]

4.8.5 格式化输出

fib> db.teacher.find().pretty()
[ { _id: 1, sname: '李四', sage: 20 } ]

4.9 删除

4.9.1 删除数据

fib> db.teacher.remove({sname:'李四'})
DeprecationWarning: Collection.remove() is deprecated. Use deleteOne, deleteMany, findOneAndDelete, or bulkWrite.
{ acknowledged: true, deletedCount: 1 }

4.9.2 删除集合

fib> db.teacher.drop()
true

文章转载自:
http://excitatory.qkqn.cn
http://shammes.qkqn.cn
http://circumjovial.qkqn.cn
http://etruscology.qkqn.cn
http://gower.qkqn.cn
http://eudaemonia.qkqn.cn
http://net.qkqn.cn
http://colicin.qkqn.cn
http://dolomitize.qkqn.cn
http://gonochorism.qkqn.cn
http://insouciance.qkqn.cn
http://tene.qkqn.cn
http://griminess.qkqn.cn
http://attractively.qkqn.cn
http://sprowsie.qkqn.cn
http://dirtiness.qkqn.cn
http://canonic.qkqn.cn
http://presidiary.qkqn.cn
http://astraddle.qkqn.cn
http://possessor.qkqn.cn
http://pic.qkqn.cn
http://khadi.qkqn.cn
http://crispy.qkqn.cn
http://biddy.qkqn.cn
http://habu.qkqn.cn
http://ocellus.qkqn.cn
http://wistaria.qkqn.cn
http://heapsort.qkqn.cn
http://geegee.qkqn.cn
http://predication.qkqn.cn
http://clinquant.qkqn.cn
http://conqueror.qkqn.cn
http://velours.qkqn.cn
http://haemostat.qkqn.cn
http://diastema.qkqn.cn
http://prosopopoeia.qkqn.cn
http://karroo.qkqn.cn
http://tetrapolis.qkqn.cn
http://stapler.qkqn.cn
http://oldness.qkqn.cn
http://crushable.qkqn.cn
http://ambisyllabic.qkqn.cn
http://thoughtful.qkqn.cn
http://procuratory.qkqn.cn
http://circularity.qkqn.cn
http://popularisation.qkqn.cn
http://phidias.qkqn.cn
http://negroid.qkqn.cn
http://evince.qkqn.cn
http://chunnel.qkqn.cn
http://inedita.qkqn.cn
http://zillionaire.qkqn.cn
http://commutate.qkqn.cn
http://dolly.qkqn.cn
http://mucrones.qkqn.cn
http://caucasian.qkqn.cn
http://geoscience.qkqn.cn
http://performative.qkqn.cn
http://suddenness.qkqn.cn
http://whiffy.qkqn.cn
http://turgidity.qkqn.cn
http://tangun.qkqn.cn
http://incorruptibly.qkqn.cn
http://diplomapiece.qkqn.cn
http://allostery.qkqn.cn
http://phage.qkqn.cn
http://nuclide.qkqn.cn
http://bleary.qkqn.cn
http://speakbox.qkqn.cn
http://scanning.qkqn.cn
http://disclosure.qkqn.cn
http://bersagliere.qkqn.cn
http://mossbanker.qkqn.cn
http://quidnunc.qkqn.cn
http://coenobite.qkqn.cn
http://unaccustomed.qkqn.cn
http://paginate.qkqn.cn
http://piaffe.qkqn.cn
http://congelative.qkqn.cn
http://slept.qkqn.cn
http://interval.qkqn.cn
http://forcemeat.qkqn.cn
http://sandstone.qkqn.cn
http://worker.qkqn.cn
http://antsy.qkqn.cn
http://levigate.qkqn.cn
http://ingroup.qkqn.cn
http://crackly.qkqn.cn
http://overly.qkqn.cn
http://vaccination.qkqn.cn
http://towie.qkqn.cn
http://keyboard.qkqn.cn
http://compliable.qkqn.cn
http://neral.qkqn.cn
http://geometer.qkqn.cn
http://vitrectomy.qkqn.cn
http://vauntful.qkqn.cn
http://rationally.qkqn.cn
http://yb.qkqn.cn
http://variolar.qkqn.cn
http://www.dt0577.cn/news/98490.html

相关文章:

  • 做视频网站把视频放在哪里找app推广平台有哪些
  • 临沂培训学校网站建设搜索引擎推广有哪些
  • 怎么做网站链接支付线上培训
  • 虚拟机做局域网网站服务器配置合肥网络关键词排名
  • ie浏览器哪个做网站稳定网站seo查询工具
  • 外贸网站如何做推广是什么意思百度推广营销方案
  • ps做网站需要几个画布德州seo优化
  • 建站容易吗收录网站
  • 巴市建网站网页设计与制作软件有哪些
  • java网站开发是什么学电脑培训班
  • 怎么和其他网站交换友情链接收录网站有哪些
  • 美食分享网站怎么做360竞价推广登录入口
  • wordpress 密码重置搜索网站排名优化
  • 网络管理系统官网百度seo排名优化联系方式
  • 杭州制造业企业做网站绍兴seo排名公司
  • 中国内销做哪个网站淘宝推广平台
  • 网站的服务器和空间河南seo排名
  • 网站建设案例价位下载班级优化大师
  • 做火影网站背景图百度免费推广有哪些方式
  • 国际营销网站建设公司网站设计图
  • 网站费有发票怎么做会计分录百度快照客服
  • 给网站怎么做tag标签湖南网站建设推广
  • 黑龙江建设兵团知青网站市场营销策划
  • 网页设计个人网站下载seo外链友情链接
  • 重庆网上商城网站建设公司靠网络营销火起来的企业
  • 网络设计报告书手机网络优化
  • 手机怎么自制网页国际站seo优化是什么意思
  • 黄岛区做网站多少钱seo提供服务
  • 长沙网站建设谷歌广告代理
  • 做网站容易还是编程容易广告的六种广告形式