MongoDB讲义

合集下载

深入学习MongoDB全面介绍基础语法及集群replicatesharding-PPT课件

深入学习MongoDB全面介绍基础语法及集群replicatesharding-PPT课件
Examples CouchDB, MongoDb Web应用(与Key-Value类似,Value 典型应用场景 是结构化的,不同的是数据库能够了解 Value的内容) 数据模型 Key-Value对应的键值对,Value为结构
化数据
数据结构要求不严格,表结构可变,不
强项
需要像关系型数据库一样需要预先定义 表结构
13
MongoDB简介
5.适用场合
• 网站数据:Mongo非常适合实时的插入,更新与查询,并具备网站实时数据存储所需 的复制及高度伸缩性。 • 缓存:由于性能很高,Mongo也适合作为信息基础设施的缓存层。在系统重启之后, 由Mongo搭建的持久化缓存层可以避免下层的数据源 过载。 • 大尺寸,低价值的数据:使用传统的关系型数据库存储一些数据时可能会比较昂贵, 在此之前,很多时候程序员往往会选择传统的文件进行存储。 • 高伸缩性的场景:Mongo非常适合由数十或数百台服务器组成的数据库。Mongo的 路线图中已经包含对MapReduce引擎的内置支持。 • 用于对象及JSON数据的存储:Mongo的BSON数据格式非常适合文档化格式的存储 及查询。
22
MongoDB操作
Document==Row
23
MongoDB操作
INSERT > er.save({name:'zhangsan',age:25,sex:true}) > er.find() { "_id" : ObjectId("4f69e680c9106ee2ec95da66"), "name" : "zhangsan", "age" : 25, "sex" : true } _id组合 ObjectId是"_id"的默认类型。ObjectId使用12字节的存储空间,每个字节二位十六进制数字 ,是一个24位的字符串 0 | 1 | 2 | 3 4 | 5 | 6 7 | 8 9 | 10 | 11 时间戳 机器 PID 计数器 1.时间戳:时间不断变化的 2.机器:主机的唯一标识码。通常是机器主机名的散列值,这样可以确保不同主机 生成不同的ObjectId,不产生冲突。 3.PID:为了确保在同一台机器上并发的多个进程产生的ObjectId是唯一的, 所以加上进程标识符(PID). 4.计数器:前9个字节保证了同一秒钟不同机器不同进程产生的ObjectId是唯一的。 后3个字节就是一个自动增加的计数器,确保相同进程同一秒产生的ObjectId也是 不一样。同一秒最多允许每个进程拥有16 777 216个不同的ObjectId。

mongodb教程

mongodb教程

mongodb教程MongoDB教程MongoDB是一种开源的、面向文档的NoSQL数据库管理系统。

它以高性能、高可扩展性和易用性而闻名,是当今最受欢迎的NoSQL数据库之一。

本文将介绍MongoDB的基本概念、使用方法和常见操作等内容,帮助读者快速上手和应用MongoDB。

1. MongoDB简介MongoDB是由MongoDB公司开发和维护的一个开源项目。

它是一个面向文档的数据库,数据以BSON(Binary JSON)格式存储,支持丰富的数据结构,包括文档、数组、嵌套文档等。

MongoDB采用基于分布式文件存储的方式,支持水平扩展和高可用性。

它适用于处理海量数据和高并发访问的场景。

2. 安装和配置MongoDB要使用MongoDB,首先需要安装和配置它。

MongoDB提供了针对多个操作系统的安装包和二进制文件,安装过程相对简单。

安装完成后,可以通过编辑配置文件来配置MongoDB的参数,例如端口号、数据库存储路径等。

默认情况下,MongoDB会将数据存储在/var/lib/mongodb目录下。

3. 连接和运行MongoDB安装和配置完成后,可以使用命令行或图形界面工具连接和运行MongoDB。

MongoDB提供了丰富的命令行工具,例如mongo、mongodump、mongorestore等,它们可以用于数据库的管理和操作。

此外,还有许多第三方的可视化工具,例如Robo 3T、MongoDB Compass等,它们提供了更友好的界面和更多的功能。

4. 数据库和集合的操作在MongoDB中,数据库是用于存储数据的容器,而集合则是一组相关的文档。

可以使用命令行或图形界面工具创建数据库和集合,并对其进行增删改查等操作。

例如,使用db.createCollection()命令可以创建一个新的集合,使用db.collection.insertOne()和db.collection.insertMany()命令可以插入一个或多个文档,使用db.collection.find()命令可以查询文档。

mongodb 基础教学 -回复

mongodb 基础教学 -回复

mongodb 基础教学-回复MongoDB 是一种流行的NoSQL 数据库,它是开源的,使用JSON 风格的文档进行数据存储。

它的设计目标是供大规模、高性能的数据存储和处理需求使用。

本文将介绍MongoDB 的基本概念和使用方法,帮助读者理解并开始使用MongoDB。

1. 什么是MongoDB?MongoDB 是一个面向文档的数据库管理系统。

与传统的关系型数据库不同,MongoDB 使用文档代替了行和列,文档以JSON 或BSON 的形式存储。

MongoDB 以文档为单位进行数据存储和查询,文档可以是不同结构和属性的,这使得MongoDB 在处理半结构化数据非常灵活和高效。

2. 安装和配置MongoDB首先,我们需要下载并安装MongoDB 软件包。

根据所使用的操作系统,可以在MongoDB 官方网站找到对应的安装包,并按照安装指南进行安装。

安装完成后,需要进行一些配置。

首先,创建一个空文件夹作为MongoDB 的数据存储位置。

然后,使用配置文件指定数据目录和其他参数:storage:dbPath: /path/to/data/dbsystemLog:destination: filepath: /path/to/mongodb.lognet:bindIp: 127.0.0.1配置完成后,启动MongoDB 服务器。

3. 数据库和集合MongoDB 中的数据存储在数据库中,数据库由集合组成,而集合则由文档组成。

可以将数据库理解为关系型数据库中的数据库,集合类似于表,文档类似于表中的行。

在MongoDB 中,可以使用以下命令来创建数据库和集合:use mydb 创建名为mydb 的数据库db.createCollection("mycollection") 在mydb 数据库中创建名为mycollection 的集合4. 插入文档插入文档是向MongoDB 中添加数据的常用操作。

MongoDB入门经典

MongoDB入门经典

2 安装和配置MongoDB
2.1.1 安装 MongoDB
2.1.2 启动 MongoDB
2.1.3 配置 MongoDB
2.1.4 停止 MongoDB
2.1 搭建MongoDB环境
A
C
2.3.2 理解 MongoDB shell
命令
2.3.1 启动 MongoDB shell
2.3.3 理解 MongoDB shell原生
F
1.5 规划数据模型
1 NoSQL和MongoDB简介
1.5.7 使用大型集合 还是大量集合
A
1.5.8 确定数据的生 命周期
B
1.5.9 考虑数据可用 性和性能
C
1.5 规划数据模型
1 NoSQL和MongoDB简介
01
02
03
1.8.1 小 1.8.2 小 1.8.3 练
测验 测验答案

1.8 作业
3.7 理 解变量 作用域
3.8 使用 JavaScri pt对象
3.9 操 作字符 串
3.10 使 用数组
3.11 添 加错误 处理
3.12 小结
3 在MongoDB shell中使 用JavaScript
3.13 问与答 3.14 作业
3 在MongoDB shell中使用 JavaScript
3 在MongoDB shell中使用JavaScript
2017
3.2 理解 JavaScript数
据类型
2019
3.4 使用运算 符
2021
3.6 创建函数
01
02
03
04
05
06
3.1 定义变量

MongoDB入门讲解

MongoDB入门讲解

2021/3/7
CHENLI
13
MongoDB下载安装
--pologSize 指定日志文件大小不超过64M.因为resync是非常操作量 大且耗时,最好通过设置一个足够大的oplogSize来避免resync(默认的 oplog大小是空闲磁盘大小的5%)。
--port 启用端口号 --fork 在后台运行 --only 指定只复制哪一个数据库 --slavedelay 指从复制检测的时间间隔 --auth 是否需要验证权限登录(用户名和密码)
2021/3/7
CHENLI
✓ 要更新所有匹配的文档,可以将update的第四个参数设置为true
✓ db.foo.update({},{"$set":{name:'tes'}},false,true)
✓ 在MongoDB找下级是按点的方式:比如user下有叫logs数组,就
2u02s1/3e/7r.logs
CHENLI
18
MongoDB应用
不可恢复。但是不会删除collection; ✓ db.collection.drop();直接删除collection; ✓ 去重? ✓ Distinct() ✓ db.collection.distinct(field, query) ✓ Field – 类型:字符串;返回非重复的字段。 ✓ Query – 类型:文档;查询条件。 ✓ er.distinct("_id", {age: 1})
✓ 配置文件启动 ➢ 在mongodb下创建mongo.config文件,编辑mongo.config,输入
dbpath=D:\mongodb\data\db logpath=D:\mongodb\log\mongo.log 进入bin目录下,输入 mongod --config /mongodb/mongo.config

MongoDB培训

MongoDB培训

22
第四部分 MongoDB高级应用
23
MongoDB 图形化管理工具
MongoVUE - 一个windows下的客户端管理工具 MongoHUB - Mac 下的 MongoDB 客户端。
Server Density - 是一个商业的监控服务提供商
MongoDB培训
> superwen > superwen@
第一部分 MongoDB简介
2
MongoDB特性
MongoDB是一个可扩展、高性能的下一代数据库,它的特点是高性能、易部署、易使用、存储 数据非常方便,主要特性有: 1、面向文档存储,json格式的文档易读,高效。 2、模式自由,支持劢态查询、完全索引,无模式。 3、高效的数据存储,效率提高。 4、支持复制和故障恢复。 5、以支持于级别的伸缩性,支持水平的数据库集群,可劢态添加额外的服务器
集合 一组文档的集合。一个集合下的稳定无模式限制。
提问:既然是这样为什么还会有多个集合?
注意:集合命名 丌能为空,\0,丌能以system.开头,丌能含有 $
数据库命名 小写 丌能含有 空格,$ \ / \0等
4
Hale Waihona Puke MongoDB的局限与不足
• • 在32位系统上,丌支持大亍2.5G的数据。 单个文档大小限制为 16 M
20
MongoDB shell 增删改查
db.addUser("theadmin","anadminpassword"); //添加用户 db.addUser("guest","passwordForGuest",true); //添加只读用户
db.auth("theadmin","anadminpassword"); //添加认证

mongodb讲解

mongodb讲解

mongodb讲解
MongoDB是一种基于文档的数据库管理系统,以非关系型数据库
技术为基础。

它已成为当今最流行的NOSQL数据库之一,广泛用于各种Web应用程序、电子商务和社交媒体。

以下是MongoDB的一些重要的特点和优势。

1. 非关系型:相对于传统的关系型数据库,MongoDB以文档的方式存
储数据,使得数据的结构更灵活,更能适应复杂多变的数据需求。

2. 非结构化数据:MongoDB可以处理非结构化数据,例如图像、音频、视频等等。

3. 扩展性:MongoDB有很好的扩展性,可以通过水平扩展增加服务器,而不用像传统关系型数据库那样需要增加硬件来实现扩展。

4. 高性能:MongoDB能够进行高效的数据读写操作,因为它能够快速
处理复杂的查询操作。

5. 数据可靠性:MongoDB提供了数据的副本备份、故障恢复等机制,
可以保证数据的可靠性和安全性。

6. 易于使用:MongoDB可以使用各种编程语言进行开发,包括Java、Python、PHP等等,相关的驱动程序和库也很齐全。

7. 数据库设计:MongoDB支持丰富的数据建模特性,可以进行更灵活、自然的数据建模。

总之,MongoDB的使用受到越来越多企业和开发者的认可和喜爱,其
高性能、扩展性、可靠性和易用性,成为该数据库领域的佼佼者。


果你需要一种可扩展、易于部署而且运行快速的数据库技术,MongoDB无疑是一种值得推荐的选择。

MongoDB入门讲解幻灯片

MongoDB入门讲解幻灯片
6
MongoDB简介
? 为什么要用Mongo?DB ? MongoD的B设计是要结合键值存储和关系型数据库的最好特性。键值存
储,因为非常简单,所以速度极快而且相对容易伸缩。关系型数据库 较难伸缩,至少很难水平伸缩,但拥有富数据模型和强大的查询语言。 如果MongoD能B介于两者之间,就能成为一款易伸缩、能存储丰富数据 结构、提供复杂查询机制的数据库。在使用场景方面, MongoD非B常适 合用做以下应用程序的主要数据存储: We应b 用程序、分析与记录应用 程序,以及任何要求有中等级别缓存的应用程序。此外,由于它能方 便地存储无Schem数a 据,MongoD还B很适合保存事先无法知晓其数据结 构的数据。
7
第二节
了解如何获得 MongoD软B件,包括如何 为自己的环境选择正确的版本,如何在
Window和s linux 中安装和检测运行。
8 返回
MongoDB下载安装
? 选择正确版本? ? MongoD所B使用的版本管理相当简单: 偶数号为稳定版 ,奇数号为开发
版。注意: 32 位产品与 64 位产品之间的区别。 32 位和 64 位版本 的数据库目前有着相同的功能,唯一的区别是: 32 位版本将每个服务 器的数据集<?????>总大小限制在 2GB左右;64 位版本没有 任何限制, 所以在生产环境中应该优先使用 64 位版本。另外, 不同的版本之间也 有可能发生变化 ? 下载Mongo?DB ? 下载地址: https:///downloads ? 安装Mongo?DB ? 在Linux中安装MongoD有B,两种方式:一、通过仓库安装 MongoD二B;、 手动安装MongoDB ? 在Window中s 安装MongoD只B,需要根据自己的需要下载安装包、解压后 运行即可。

mongodb复习资料

mongodb复习资料

mongodb复习资料MongoDB复习资料MongoDB是一种流行的NoSQL数据库,被广泛应用于各种大规模数据管理和处理场景。

本文将为读者提供一份MongoDB复习资料,帮助大家回顾和巩固相关知识。

一、MongoDB简介MongoDB是一个开源的文档数据库,采用了面向文档的数据模型。

它以BSON (Binary JSON)格式存储数据,支持动态模式和灵活的查询语言。

相比传统的关系型数据库,MongoDB在处理大量数据和高并发访问时表现更为出色。

二、数据模型MongoDB的数据模型是以文档为基本单位的。

文档是一个键值对的集合,类似于关系型数据库中的一行数据。

文档可以包含各种类型的值,如字符串、整数、数组、嵌套文档等。

通过使用文档,MongoDB可以轻松地表示复杂的数据结构。

三、集合与文档MongoDB中的数据存储在集合(Collection)中,一个集合可以包含多个文档。

集合类似于关系型数据库中的表,文档则类似于表中的行。

通过使用集合和文档,MongoDB可以高效地存储和查询数据。

四、索引索引是MongoDB中提高查询性能的重要机制。

MongoDB支持各种类型的索引,如单字段索引、复合索引、文本索引等。

通过创建适当的索引,可以加快查询速度并提高系统性能。

五、查询语言MongoDB的查询语言非常灵活,支持各种类型的查询操作。

常见的查询操作包括查找、排序、过滤、投影等。

通过熟练掌握查询语言,可以高效地检索和处理数据。

六、聚合框架MongoDB提供了强大的聚合框架,用于处理和分析大规模数据集。

聚合框架支持各种聚合操作,如分组、排序、筛选、计数等。

通过使用聚合框架,可以进行复杂的数据处理和统计分析。

七、事务处理MongoDB从版本4.0开始支持事务处理。

事务是一组操作的逻辑单元,要么全部执行成功,要么全部回滚。

通过使用事务,可以确保数据的一致性和完整性。

八、安全性MongoDB提供了多种安全机制,保护数据免受未经授权的访问和恶意攻击。

mongodb介绍精品PPT课件

mongodb介绍精品PPT课件
“province”:”jiangxi”, “city”:”jiujiang”, “country”:”china” }
MongoDB 文档(document) 集合(collection) 数据库(database)
关系型数据库 行(row) 表(table) 数据库(database)
数据类型
*文件的分隔是Mongodb系统自动分隔的。
目录
Mongodb介绍 ➢ 结构介绍 ➢ 复制原理 ➢ 分片原理
Mongodb 应用举例 ➢ 架构部署 ➢ 数据模型
复制冗余分类
1、Master-Slave Replication
Master
Slave
Slave
1、Replica Set
Primary
这个值很重要,
在选举(如master宕 机时)新primary时, 会选择ts最大的那 个secondary作为新
• 面向文档存储, 文档的检索方式, 类似JAVASCRIPT。
易使用 • 文档存储方式是BJSON, 数据格式非常类似JS的JSON格式。
模式自 • 文档内部可以定义很多数据类型, 文档可动态变化添加。 由
适用场景
实时的插入、更新、查询, 具备数据存储的复制
适合由数十台、数百台组成
的数据库,MONGODB包含 了MAPREDUCE的内置支持
应用架构
Application
MMP
MMM
Mongo Service
C++ API
Mongo Mongo Mongo Mongo Mongo Dump restore import export stat
服务与支撑
JAVA API
WEB API

MongoDB入门到精通-PPT版

MongoDB入门到精通-PPT版
MongoDB技术分享
@zhangyu
什么是MongoDB? 为什么我会使用用它?
MongoDB是什么? {name:’mongo’,type:’DB’} MongoDB (from “humongous”) MongoDB是一一个开源、可扩展、高高性能、面面 向文文档文文的数据库,用用C++编写。
{name:”zhangyu”, like:”读书”} {name:”malong”, like:”电影”} …….
Collection 喜好
为什么Document中没有主键ID ?
ObjectID!
ObjectID是_id(_id是MongoDB在每个文文档中的默认唯一一 标识的名称)的默认类型。
/manual/reference/bson-types/
{ //传统 “Status”:0, //数组,包含2个元素 “Messages”:[ “0”, “1” ], //内嵌文文档 “ResponseBody”:{ “name”:“zhangyu”, “email”:[ “zhangyuu@gall.me”, “uuzhangyu@” ] } //Java newDate() “Date”:ISODate("2013-11-25T17:32:45.427+-800") }
客户端 内存 硬盘
浅探理 数据文文件 DBname.0, DBname.1, DBname.2 …
DBname.0 DBname.1 DBname.2
DBname.3
⺫目目录:
1. 面面向文文档存储(Document-Oriented Storage) 2. 全索引支支持(Full Index Support) 3. 复制&高高可用用性(Replication & High Availability ) 4. 自自动分片片(Auto-Sharding) 5. 查询(Querying) 6. Map / Reduce 7. GridFS

Mongodb数据库基础入门(一)

Mongodb数据库基础入门(一)

Mongodb数据库基础入门(一)Mongodb介绍Mongodb是一个基于分布式文件存储的数据库,由C 语言编写,为WEB应用提供可扩展的高性能数据存储解决方案Mongodb是一款介于关系型数据库与非关系型数据库之间的产品, Mongodb是不同于以往的如redis、memcached,它是一种叫文档数据库,存储的是文档(bson-->json的二进制化)特点:最大的特点是支持查询语言非常强大,内部执行的引擎是JS解释器,把文档存储成bson结构,查询时将文档转换成JS对象文件,并通过熟悉JS语法来操作同传统数据库比较:1、传统数据库是结构化数据,有表结构,每一行内容是符合表结构,且列的类型也一样2、mongodb数据库是以文档形式存储数据,每一个文档都是有自己独特的结构(js对象)与属性、值,因此它没有特定的规范与格式Mongodb安装官方网站:下载最新的stable版本[root@mingongge ~]# cd /usr/local/src/[root@mingongge src]# wget /dr/fastdl./linux/mongodb-linux-x86_64-rhel62-3.4.6.tgz[root@Centos-2 src]# tar zxf mongodb-linux-x86_64-rhel62-3.4.6.tgz[root@Centos-2 src]# cd mongodb-linux-x86_64-rhel62-3.4.6[root@Centos-2 mongodb-linux-x86_64-rhel62-3.4.6]# cd bin/[root@Centos-2 bin]# lltotal 277780-rwxr-xr-x 1 root root 10431547 Jul 6 02:23 bsondump#二进制导出(bson结构)-rwxr-xr-x 1 root root 29870496 Jul 6 02:48 mongo#客户端-rwxr-xr-x 1 root root 54389424 Jul 6 02:48 mongod#服务端-rwxr-xr-x 1 root root 12771652 Jul 6 02:24 mongodump #导出数据库-rwxr-xr-x 1 root root 10783691 Jul 6 02:23 mongoexport #导出易识别的json文档或CSV-rwxr-xr-x 1 root root 10668482 Jul 6 02:23 mongofiles-rwxr-xr-x 1 root root 10942731 Jul 6 02:23 mongoimport -rwxr-xr-x 1 root root 10433507 Jul 6 02:24 mongooplog-rwxr-xr-x 1 root root 53753432 Jul 6 02:48 mongoperf-rwxr-xr-x 1 root root 14070941 Jul 6 02:24 mongoreplay-rwxr-xr-x 1 root root 14127528 Jul 6 02:24 mongorestore #导入数据库-rwxr-xr-x 1 root root 30539024 Jul 6 02:48 mongos#路由器(分片)-rwxr-xr-x 1 root root 11003296 Jul 6 02:23 mongostat#状态-rwxr-xr-x 1 root root 10631445 Jul 6 02:24 mongotop[root@Centos-2 src]# mv mongodb-linux-x86_64-rhel62-3.4.6 /usr/local/mongodb[root@Centos-2 src]# cd /usr/local/mongodb/启动服务创建数据目录与日志目录[root@Centos-2 ~]# mkdir /data/mongodb -p[root@Centos-2 ~]# mkdir /data/mongodblog -p[root@Centos-2 mongodb]# ./bin/mongod --dbpath /data/mongodb/ --logpath /data/mongodblog/mongo.log --fork --port 27017about to fork child process, waiting until server is ready for connections.forked process: 19027child process started successfully, parent exiting[root@Centos-2 mongodb]# lsof -i :27017COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAMEmongod 19027 root 7u IPv4 48419 0t0 TCP *:27017 (LISTEN) 参数说明:--dbpath 指定数据存储目录--logpath 指定日志存储目录--fork 后台运行--port 指定端口(默认27017)连接数据库[root@Centos-2 mongodb]# ./bin/mongoMongoDB shell version v3.4.6connecting to: mongodb://127.0.0.1:27017MongoDB server version: 3.4.6Server has startup warnings:2017-07-29T10:36:50.683 0800 I STORAGE [initandlisten]2017-07-29T10:36:50.683 0800 I STORAGE [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine2017-07-29T10:36:50.683 0800 I STORAGE [initandlisten] ** See http://dochub./core/prodnotes-filesystem2017-07-29T10:36:51.494 0800 I CONTROL [initandlisten] 2017-07-29T10:36:51.494 0800 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database.2017-07-29T10:36:51.494 0800 I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted.2017-07-29T10:36:51.494 0800 I CONTROL [initandlisten] ** WARNING: You are running this process as the root user, which is not recommended.2017-07-29T10:36:51.494 0800 I CONTROL [initandlisten] 2017-07-29T10:36:51.495 0800 I CONTROL [initandlisten] 2017-07-29T10:36:51.495 0800 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.2017-07-29T10:36:51.495 0800 I CONTROL [initandlisten] ** We suggest setting it to 'never'2017-07-29T10:36:51.495 0800 I CONTROL [initandlisten] 2017-07-29T10:36:51.495 0800 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'.2017-07-29T10:36:51.496 0800 I CONTROL [initandlisten] ** We suggest setting it to 'never'2017-07-29T10:36:51.496 0800 I CONTROL [initandlisten] 2017-07-29T10:36:51.496 0800 I CONTROL [initandlisten] ** WARNING: soft rlimits too low. rlimits set to 7671 processes, 65535 files. Number of processes should be at least 32767.5 : 0.5 times number of files.2017-07-29T10:36:51.496 0800 I CONTROL [initandlisten]报错解决方法如下:WARNING: Using the XFS filesystem is strongly recommend ed with the WiredTiger storage engine强烈建议使用带WiredTiger存储引擎的XFS文件系统WARNING:Access control is not enabled for the database.意思是:未对数据库启用访问控制,对数据和配置的读写访问不受限制解决方法:开启数据库的认证就可以解决在配置文件mongod.conf中开启,如下:security:authorization: enabledWARNING:/sys/kernel/mm/transparent_hugepage/enabled is 'always'.#cat /sys/kernel/mm/transparent_hugepage/enabled[always] madvise never关闭命令:#echo never > /sys/kernel/mm/transparent_hugepage/enab ledWARNING:/sys/kernel/mm/transparent_hugepage/defrag is 'always'.将/sys/kernel/mm/transparent_hugepage/defrag设置为never#cat /sys/kernel/mm/transparent_hugepage/defrag[always] madvise never关闭命令:echo never >/sys/kernel/mm/transparent_hugepage/defragWARNING:soft rlimits too low. rlimits set to 1024 processes, 64000 files. Number of processes should be at least 32000 设置ulimitvi /etc/security/limits.confmongod soft nofile 64000mongod hard nofile 64000mongod soft nproc 32000mongod hard nproc 32000重启mongodb服务后重新登陆[root@Centos-2 mongodb]# ./bin/mongoMongoDB shell version v3.4.6connecting to: mongodb://127.0.0.1:27017MongoDB server version: 3.4.6> show databases;admin 0.000GBlocal 0.000GB> show dbs; #查看当前的数据库admin 0.000GB #管理数据库local 0.000GB来源:。

快速掌握mongoDB(三)——mongoDB的索引详解

快速掌握mongoDB(三)——mongoDB的索引详解

快速掌握mongoDB(三)——mongoDB的索引详解1 mongoDB索引的管理 本节介绍mongoDB中的索引,熟悉mysql/sqlserver等关系型数据库的⼩伙伴应该都知道索引对优化数据查询的重要性。

我们先简单了解⼀下索引:索引的本质就是⼀个排序的列表,在这个列表中存储着索引的值和包含这个值的数据(数据row或者document)的物理地址,索引可以⼤⼤加快查询的速度,这是因为使⽤索引后可以不再扫描全表来定位某⾏的数据,⽽是先通过索引表找到该⾏数据对应的物理地址(多数为B-tree查找),然后通过地址来访问相应的数据。

索引可以加快数据检索、排序、分组的速度,减少磁盘I/O,但是索引也不是越多越好,因为索引本⾝也是数据表,需要占⽤存储空间,同时索引需要数据库进⾏维护,当我们对索引列的值进⾏增改删操作时,数据库需要更新索引表,这会增加数据库的压⼒。

我们要根据实际情况来判断哪些列适合添加索引,哪些列不适合添加索引,⼀般遵循的规律如下: 主/外键列,主键⽤于强制该列的唯⼀性和组织表中数据的排列结构;外键可以加快连接的速度; 经常⽤于⽐较的类(⼤于⼩于等于等),因为索引已经排序,值就是⼤于/⼩于的分界点; 经常进⾏范围搜索,因为索引已经排序,其指定的范围是连续的; 经常进⾏排序的列,因为索引已经排序,这样查询可以利⽤索引的排序,加快排序查询时间; 经常进⾏分组的列,因为索引已经排序,同⼀个值的所有数据地址会聚集在⼀块,很⽅便分组。

我们看⼀下mongoDB的索引使⽤,⾸先准备数据:erinfos.insertMany([{_id:1, name: "张三", age: 23,level:10, ename: { firstname: "san", lastname: "zhang"}, roles: ["vip","gen" ]},{_id:2, name: "李四", age: 24,level:20, ename: { firstname: "si", lastname: "li"}, roles:[ "vip" ]},{_id:3, name: "王五", age: 25,level:30, ename: { firstname: "wu", lastname: "wang"}, roles: ["gen","vip" ]},{_id:4, name: "赵六", age: 26,level:40, ename: { firstname: "liu", lastname: "zhao"}, roles: ["gen"] },{_id:5, name: "⽥七", age: 27, ename: { firstname: "qi", lastname: "tian"}, address:'北京' },{_id:6, name: "周⼋", age: 28,roles:["gen"], address:'上海' }]); 索引的增删改查还是⼗分简单的,我们看⼀下索引管理的⼏个⽅法://创建索引,值1表⽰正序排序,-1表⽰倒序排序 erinfos.createIndex({age:-1})//查看userinfos中的所有索引 erinfos.getIndexes()//删除特定⼀个索引 erinfos.dropIndex({name:1,age:-1})//删除所有的索引(主键索引_id不会被删除) erinfos.dropIndexes()//如果我们要修改⼀个索引的话,可以先删除索引然后在重新添加。

mongodb技术专题讲座

mongodb技术专题讲座
Person集合-----------(多) { _id:ObjectID(12个字节组成) name:"张三" age:23 } 人员组集合------------(一) { name:"一组", persons:[ ObjectID("aaaaa"), ObjectID("AAABBB") ..... ] }
2. MongoDB的安装配置
MONGODB下载安装
1、访问mongodb 官网( https:/// ), 下载 自己系统关联版本。
2.安装完后,创建数据库文件的存放位置,d:/MongoDB/data/db。 创建日志文件存放位置,d:/MongoDB/data/log
(启动mongodb服务之前需要必须创建数据库文件的存放文件夹, 否则命令不会自动创 建,而且不能启动成功。)
3. 启动mongodb服务
打开cmd命令行,进入D:\mongodb\bin目录,输入如下的命令启动mongodb服务: D:/mongodb/bin>mongod --dbpath D:\mongodb\data\db 4. mongodb默认连接端口27017,如果出现如图的情况,
3. 连接MongoDB
使用客户端工具(Robomongo)


下载Rongomongo 进行安装。 https:///download 在启动之前,首先将MongoDB服务启动起来。 创建新的连接 创建数据库
使用客户端工具(Robomongo)
4用场合:一对多且多的一端内容因为各种理由需要单独存在的情况下可 以通过数组的方式引用多的一方的。
mongodb数据库设计原则

3.一对非常多 one-to-squillions 父级引用(mongodb每 个文档的最大16M)

MongoDB数据库技术入门

MongoDB数据库技术入门

MongoDB数据库技术入门MongoDB是一款非关系型数据库,采用类似于Javascript的BSON格式存储数据,广泛应用于Web、移动应用、物联网等领域。

本文将为大家介绍MongoDB的基本概念和使用方法。

一、MongoDB概述MongoDB由10gen公司于2007年创建,目标是提供一种可扩展的高性能、易使用、可靠的数据库系统。

与传统关系型数据库相比,MongoDB具有更好的可扩展性和更加灵活的数据模型。

它支持丰富的查询语言,并具有高效的读写速度,在大数据处理方面有着很好的表现。

MongoDB的特点有:1. 高可扩展性:支持集群分布式部署,支持数据分片和自动负载均衡。

2. 易用性:MongoDB采用类似于Javascript的BSON格式存储数据,具有很好的可读性和易用性。

3. 数据模型灵活:MongoDB没有固定的模式,数据结构不需要使用预先定义的模式,可提供更加灵活的数据模型。

4. 高性能:MongoDB支持并发读写操作和索引,读取速度快。

5. 支持丰富的查询语言:MongoDB支持丰富的查询语言,包括聚合查询、地理空间查询、文本搜索等。

二、 MongoDB的安装MongoDB的安装非常简单,只需下载相应的安装包即可。

安装完毕后,在命令行界面键入mongo,即可进入MongoDB的交互式命令行环境。

安装完毕后,需要配置环境变量。

在Windows环境下,可将mongod.exe所在路径加入PATH中,使得mongod命令可直接在命令行中使用。

三、 MongoDB的基本操作1. 创建数据库和集合MongoDB中的数据都存储在集合(collection)中,集合相当于关系型数据库中的表。

要创建一个新的数据库和集合,只需在交互式命令行环境中输入:> use mydb> db.createCollection("user")这里,use mydb用于创建名为mydb的数据库,而db.createCollection("user")则用于创建名为user的集合。

MongoDB教程:一个简单易懂的教程以帮助你理解MongoDB概念说明书

MongoDB教程:一个简单易懂的教程以帮助你理解MongoDB概念说明书

About the T utorialMongoDB is an open-source document database and leading NoSQL database. MongoDB is written in C++.This tutorial will give you great understanding on MongoDB concepts needed to create and deploy a highly scalable and performance-oriented database.AudienceThis tutorial is designed for Software Professionals who are willing to learn MongoDB Database in simple and easy steps. It will throw light on MongoDB concepts and after completing this tutorial you will be at an intermediate level of expertise, from where you can take yourself at higher level of expertise.PrerequisitesBefore proceeding with this tutorial, you should have a basic understanding of database, text editor and execution of programs, etc. Because we are going to develop high performance database, so it will be good if you have an understanding on the basic concepts of Database (RDBMS).Copyright & DisclaimerCopyright 2018 by Tutorials Point (I) Pvt. Ltd.All the content and graphics published in this e-book are the property of Tutorials Point (I) Pvt. Ltd. The user of this e-book is prohibited to reuse, retain, copy, distribute or republish any contents or a part of contents of this e-book in any manner without written consent of the publisher.We strive to update the contents of our website and tutorials as timely and as precisely as possible, however, the contents may contain inaccuracies or errors. Tutorials Point (I) Pvt. Ltd. provides no guarantee regarding the accuracy, timeliness or completeness of our website or its contents including this tutorial. If you discover any errors on our website or inthistutorial,******************************************T able of ContentsAbout the Tutorial (i)Audience (i)Prerequisites (i)Copyright & Disclaimer (i)Table of Contents (ii)MONGODB (1)1.MongoDB ─ Overview (2)2.Mongo DB ─ Advantages (4)3.MongoDB ─ Environment (5)4.MongoDB ─ Data Modelling (10)5.MongoDB ─ Create Database (12)6.MongoDB ─ Drop Database (13)7.MongoDB ─ Create Collection (14)8.MongoDB ─ Drop Collection (16)9.MongoDB ─ Datatypes (17)10.MongoDB ─ Insert Document (18)11.MongoDB ─ Query Document (20)12.MongoDB ─ Update Document (24)13.MongoDB ─ Delete Document (26)14.MongoDB ─ Projection (28)15.MongoDB ─ Limit Records (29)16.MongoDB ─ Sort Records (31)17.MongoDB ─ Indexing (32)18.Mo ngoDB ─ Aggregation (34)19.MongoDB ─ Replication (38)20.MongoDB ─ Sharding (41)21.Mo ngoDB ─ Create Backup (43)22.MongoDB ─ Deployment (45)23.MongoDB ─ Java (48)24.MongoD B ─ PHP (60)ADVANCED MONGODB (66)25.MongoDB ─ Relationships (67)26.MongoDB ─ Database References (70)27.MongoDB ─ Covered Queries (72)28.MongoDB ─ Analyzing Queries (74)29.MongoDB ─ Atomic Operations (76)30.MongoDB ─ Advanced Indexing (78)31.MongoDB ─ Indexing Limitations (80)32.MongoDB ─ ObjectId (81)33.MongoDB ─ MapReduce (83)34.MongoDB ─ Text Search (86)35.MongoDB ─ Regular Expression (88)36.MongoDB ─ RockMongo (90)37.MongoDB ─ GridFS (91)38.Mong oDB ─ Capped Collections (93)39.MongoDB ─ Auto-Increment Sequence (95)MongoDB4MongoDB is a cross-platform, document oriented database that provides, high performance, high availability, and easy scalability. MongoDB works on concept of collection and document.DatabaseDatabase is a physical container for collections. Each database gets its own set of files on the file system. A single MongoDB server typically has multiple databases.CollectionCollection is a group of MongoDB documents. It is the equivalent of an RDBMS table. A collection exists within a single database. Collections do not enforce a schema. Documents within a collection can have different fields. Typically, all documents in a collection are of similar or related purpose.DocumentA document is a set of key-value pairs. Documents have dynamic schema. Dynamic schema means that documents in the same collection do not need to have the same set of fields or structure, and common fields in a collection's documents may hold different types of data. The following table shows the relationship of RDBMS terminology with MongoDB.5MongoDB6Sample DocumentFollowing example shows the document structure of a blog site, which is simply a comma separated key value pair._id is a 12 bytes hexadecimal number which assures the uniqueness of every document. You can provide _id while inserting the document. If you don’t provide then MongoDB provides a unique id for every document. These 12 bytes first 4 bytes for the current timestamp, next 3 bytes for machine id, next 2 bytes for process id of MongoDB server and remaining 3 bytes are simple incremental VALUE.Any relational database has a typical schema design that shows number of tables and the relationship between these tables. While in MongoDB, there is no concept of relationship.Advantages of MongoDB over RDBMS∙Schema less: MongoDB is a document database in which one collection holds different documents. Number of fields, content and size of the document can differ from one document to another.∙Structure of a single object is clear.∙No complex joins.∙Deep query-ability. MongoDB supports dynamic queries on documents using a document-based query language that's nearly as powerful as SQL.∙Tuning.∙Ease of scale-out: MongoDB is easy to scale.∙Conversion/mapping of application objects to database objects not needed.∙Uses internal memory for storing the (windowed) working set, enabling faster access of data.Why Use MongoDB?∙Document Oriented Storage: Data is stored in the form of JSON style documents.∙Index on any attribute∙Replication and high availability∙Auto-sharding∙Rich queries∙Fast in-place updates∙Professional support by MongoDBWhere to Use MongoDB?∙Big Data∙Content Management and Delivery∙Mobile and Social Infrastructure7∙User Data Management∙Data Hub89Let us now see how to install MongoDB on Windows.Install MongoDB on WindowsTo install MongoDB on Windows, first download the latest release of MongoDB from /downloads . Make sure you get correct version of MongoDB depending upon your Windows version. To get your Windows version, open command prompt and execute the following command. 32-bit versions of MongoDB only support databases smaller than 2GB and suitable only for testing and evaluation purposes.Now extract your downloaded file to c:\ drive or any other location. Make sure the name of the extracted folder is mongodb-win32-i386-[version] or mongodb-win32-x86_64-[version]. Here [version] is the version of MongoDB download.Next, open the command prompt and run the following command. In case you have extracted the MongoDB at different location, then go to that path by using command cd FOOLDER/DIR and now run the above given process.MongoDB requires a data folder to store its files. The default location for the MongoDB data directory is c:\data\db. So you need to create this folder using the Command Prompt. Execute the following command sequence. If you have to install the MongoDB at a different location, then you need to specify an alternate path for \data\db by setting the path dbpath in mongod.exe . For the same, issue the following commands.10In the command prompt, navigate to the bin directory present in the MongoDB installation folder. Suppose my installation folder is D:\set up\mongodbThis will show waiting for connections message on the console output, which indicates that the mongod.exe process is running successfully.Now to run the MongoDB, you need to open another command prompt and issue the following command.This will show that MongoDB is installed andrun successfully. Next time when you run MongoDB, you need to issue only commands.Install MongoDB on UbuntuRun the following command to import the MongoDB public GPG k ey −Create a /etc/apt/sources.list.d/mongodb.list file using the following command.Now issue the following command to update the repository −Next install the MongoDB by using the following command −In the above installation, 2.2.3 is currently released MongoDB version. Make sure to install the latest version always. Now MongoDB is installed successfully.Start MongoDBStop MongoDBRestart MongoDBTo use MongoDB run the following command.This will connect you to running MongoDB instance.MongoDB HelpTo get a list of commands, type db.help() in MongoDB client. This will give you a list of commands as shown in the following screenshot.1112MongoDB StatisticsTo get stats about MongoDB server, type the command db.stats() in MongoDB client. This will show the database name, number of collection and documents in the database. Output of the command is shown in the following screenshot.13Data in MongoDB has a flexible schema.documents in the same collection. They do not need to have the same set of fields or structure, and common fields in a collection’s documents may hold different types of data.Some considerations while designing Schema in MongoDB∙Design your schema according to user requirements.∙Combine objects into one document if you will use them together. Otherwise separate them (but make sure there should not be need of joins).∙Duplicate the data (but limited) because disk space is cheap as compare to compute time.∙Do joins while write, not on read.∙Optimize your schema for most frequent use cases.∙Do complex aggregation in the schema.ExampleSuppose a client needs a database design for his blog/website and see the differences between RDBMS and MongoDB schema design. Website has the following requirements.∙Every post has the unique title, description and url.∙Every post can have one or more tags.∙Every post has the name of its publisher and total number of likes.∙Every post has comments given by users along with their name, message, data-time and likes.∙On each post, there can be zero or more comments.In RDBMS schema, design for above requirements will have minimum three tables.14While in MongoDB schema, design will have one collection post and the following structure:15So while showing the data, in RDBMS you need to join three tables and in MongoDB, data will be shown from one collection only.1617In this chapter, we will see how to create a database in MongoDB.The use CommandMongoDB use DATABASE_NAME is used to create database. The command will create a new database if it doesn't exist, otherwise it will return the existing database.SyntaxBasic syntax of use DATABASE statement is as follows: ExampleIf you want to create a database with name <mydb>, then use DATABASE statement would be as follows: To check your currently selected database, use the command db If you want to check your databases list, use the command show dbs . Your created database (mydb) is not present in list. To display database, you need to insert at least one document into it.MongoDB18In MongoDB default database is test. If you didn't create any database, then collections will be stored in test database.MongoDB19In this chapter, we will see how to drop a database using MongoDB command.The dropDatabase() MethodMongoDB db.dropDatabase() command is used to drop a existing database.SyntaxBasic syntax of dropDatabase() command is as follows: This will delete the selected database. If you have not selected any database, then it will delete default 'test' database.ExampleFirst, check the list of available databases by using the command, show dbs . If you want to delete new database <mydb>, then dropDatabase() command would be as follows: Now check list of databases.In this chapter, we will see how to create a collection using MongoDB.The createCollection() MethodMongoDB db.createCollection(name, options) is used to create collection.SyntaxBasic syntax of createCollection() command is as follows:In the command, name is name of collection to be created. Options is a document and is used to specify configuration of collection.Options parameter is optional, so you need to specify only the name of the collection. Following is the list of options you can use:2021While inserting the document, MongoDB first checks size field of capped collection, then it checks max field. ExamplesBasic syntax of createCollection() method without options is as follows:You can check the created collection by using the command show collections .The following example shows the syntax of createCollection() method with few important options:In MongoDB, you don't need to create collection. MongoDB creates collection automatically,when you insert some document.End of ebook previewIf you liked what you saw…Buy it from our store @ https://22。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
• db. collection名称.drop()
删除当前的数据库
• db.dropDatabase()
对文档的CRUD操作
增加数据
• db.文档名称.save()
查询数据
• db.文档名称.find()
修改数据
• db.文档名称.update()
删除数据
• db.文档名称.remove()
条件操作符
$gt : > $lt : < $gte: >= $lte: <= $ne : !=、<> $in : in $nin: not in $all: all $not: 反匹配
增加数据示例
db.stu.save({stu_id:1,stu_name:“tom",stu_age:24}); 查询结果: • { "_id" : ObjectId("51aabe36775807593aaf765d"), "stu_id" : 1, "stu_name" : "tom", "stu_age" : 24 } _id字段是系统自动产生的一个唯一值标识,相当于自动生成的主键 ,是一个24位的字符串,可以在保持全局唯一,由以下四部分组成 • TimeStamp前4位是一个unix的时间戳,是一个int类别 • Machine 接下来的三个字节,就是所在主机的唯一标识符 • pid接下来的两位就是产生objectid的进程标识符 • increment后面的三个字节是一个自动增加的计数器 _id字段值也可以手动指定 • db.stu.save({_id:3,stu_id:3,stu_name:"rose",stu_age:25});
卸载MongoDB
1.在命令行下执行mongod –remove 删除注册的服务 2.删除硬盘文件
通过命令行进入数据库
默认会连接test数据库
数据库登陆验证
MongoDB数据库默认是无需登陆的,就是不用账号和密 码也可以使用 如果需要数据库登陆验证,则需要在正常启动之后,先进 入某个数据库,然后在这个数据库下添加一个新用户
查询stu_id not in (21,24,28)
• db.stu.find({ "stu_id" : { "$nin" : [21, 24, 28] } })
查询phone=[110,119,120]
• db.stu.find({ "phone" : { "$all" : [110, 120, 119] } }) • 用$all运算数组元素顺序可颠倒,一样可以匹配
• db.stu.find().count();
select count(*) from stu where stu_ioVUE设置显示本地时间
基本数据类型
null
• null类型用于表示空值或不存在的字段,如:{“one”:null}
布尔类型
• 布尔类型有两上值,’true‟和’false‟ ,如:{“one”:true}
32位整数
• 在由于mongoDB的控制台使用JS引擎进行输入,而JS仅支持64 位浮点数,所以32位整数将会被自动转义
MongoDB
NOSQL数据库
NOSQL数据库简介
NoSQL,指的是非关系型的数据库 ,意思是不仅仅是 SQL语句 NoSQL数据库的优点
• • • • 可以处理超大量的数据 运行在便宜的PC服务器集群上 击碎了性能瓶颈 操作简单
NoSQL数据库的缺点
• 不支持事务ACID特性 • 不适合复杂数据库设计
64位整数
• 64位整数与32位整数一样,在MongoDB控制台使用时,会转义成 64位浮点数
64位浮点数
• MongoDB控制台数字的默认类型,如:{“one”:2.02} {“one”:10}
基本数据类型2
字符串
• 如:{“one”:”Hello World”}
对象id
• 对象id是文档中唯一的12位的ID
• show dbs
查看所有的collection
• show collections
查看各collection的状态
• db.printCollectionStats()
常用命令2
拷贝数据库
• db.copyDatabase('mail_addr','mail_addr_tmp')
删除collection
内嵌文档
• 内嵌文档是将另一个文档当成这个文档中某个键的值,即嵌套JSON数据
条件查询数据示例
查询所有数据
• db.stu.find();
查询stu_id=1
• db.stu.find({ "stu_id" : 1 })
查询stu_id=1 and stu_name=“tom”
• db.stu.find({ "stu_id" : 1, "stu_name" : "tom" })
日期
• 日期类型是从标准纪元(公元1年)开始的始的毫秒数,不存储时区 ,如:{“one”:new Date()}
正则表达式
• 文档键值可以包含正则表达式,其正则表达式采用JS语法来表示 ,如:{“one”:/ho/i}
代码
• 文档中可以包含JS代码 如:{“one”:function(){}}
• • • • db.stu.find({ }, { "stu_id" : 1, "stu_name" : "" }) db.stu.find({ }, { "stu_id" : -1, "stu_name" : "abcd" }) db.stu.find({ }, { "stu_id" : 3, "stu_name" : true }) 以上只要非0值默认都为true,0为false
MongoDB本身并没有类似MySQL的auto_increment类型
通过工具插入数据
利用JS脚本循环插入数据
for (var i=10;i<=40;i ++) { db.stu.save({stu_id:i,stu_name:"simth"+i,stu_age:20+i}); }
在命令行下查看多条数据,需要用it命令查看更多
Mongo数据库服务器
• 相当于普通数据库的服务器
数据库DB
• 相当于一个MYSQL或者SQLSERVER数据库 • 无需Create Database之类的语句,直接use 数据库名,不存在的 数据库会自动创建
数据集合DBCollection(也称作名称空间namespace)
• 可以看做是一个普通数据库的表 • 不需要提前创建一个集合,在第一次增加数据的时候会自动创建
分页查询数据
查询limit 5,10,从结果集第6行开始,返回10行
• db.stu.find({ }).skip(5).limit(10)
按字段排序
order by stu_age,1为升序,-1为降序
• db.stu.find({ }).sort({ "stu_age" : 1 }) • db.stu.find({ }).sort({ "stu_age" : -1 })
文档DBObject、BasicDBObject
• 一个文档就是一个JSON字符串 • 可以把文档看做是一行记录
常用命令
查看用户列表
• ers.find()
删除用户
• db.removeUser('name')
查看所有用户
• show users
查看所有数据库
• use icss #切换数据库 • db.addUser(“admin”,“admin”) #添加新用户
然后需要在启动服务时增加--auth参数,表示登陆认证模 式 用如下命令登陆db.auth('admin','admin');
• 返回1表示登陆成功 • 返回0表示登陆失败
MongoDB的核心对象组成
条件查询数据示例2
查询stu_birthdate=„1983-4-7‟
• db.stu.find({stu_birthdate:new Date(1983,3,7)});
查询stu_id in (21,24,28)
• db.stu.find({ "stu_id" : { "$in" : [21, 24, 28] } })
消除重复行
select distinct stu_name from stu where stu_name=“simth40” • db.stu.distinct('stu_name',{stu_name:"simth40"});
统计查询
select count(*) from stu;
MongoDB简介
MongoDB事实上不是芒果的意思,而是超大数据库的含 义 MongoDB不是唯一的NOSQL数据库,但却是最普及的 NOSQL数据库
• 是一个介于关系数据库和非关系数据库之间的产品,是非关系数 据库当中功能最丰富,最像关系数据库的 • 由C++语言编写。旨在为WEB应用提供可扩展的高性能数据存储 解决方案 • 支持的数据结构非常松散,是类似json的bson格式,因此可以存 储比较复杂的数据类型 • 最大的特点是他支持的查询语言非常强大,其语法有点类似于面 向对象的查询语言,几乎可以实现类似关系数据库单表查询的绝 大部分功能,而且还支持对数据建立索引
相关文档
最新文档