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

网站建设动态重庆seo关键词优化服务

网站建设动态,重庆seo关键词优化服务,咋创建自己的网站,wordpress积分查看一、概述MongoDB中的记录是一个文档,它是一个数据结构组成 字段和值对。MongoDB文档类似于JSON。对象。字段的值可能包括其他文档、数组、 和文档数组:数据库(Database):和关系型数据库一样,每个数据库中有…

一、概述

MongoDB中的记录是一个文档,它是一个数据结构组成 字段和值对。MongoDB文档类似于JSON。对象。

字段的值可能包括其他文档、数组、 和文档数组:

  • 数据库(Database):和关系型数据库一样,每个数据库中有自己的用户权限,不同的项目组可以使用不同的数据库

  • 集合(Collection): 集合指的是文档组(类似于 Mysql 中的表的概念),里面可以存储许多文档

  • 文档(Document): 文档是 MongoDB 中最基本的数据单元,由键值对组成,类似于 JSON 格式,可以存储不同字段,字段的值可以包括其他文档、数组和文档数组

官网:https://www.mongodb.com/

二、主要特点

1、高性能

MongoDB提供高性能的数据持久性。特别

  • 对嵌入式数据模型的支持减少了数据库上的 I/O 活动 系统。

  • 索引支持更快的查询,并且可以包含来自嵌入式的键 文档和数组。

2、查询接口

MongoDB Query API 支持读写 操作(CRUD)以及:

  • 数据聚合

  • 文本搜索和地理空间查询。

3、高可用性

MongoDB的复制工具,称为副本集提供:

  • 自动故障转移

  • 数据冗余。

一个副本集是一组 维护相同数据集的MongoDB服务器,提供冗余 以及提高数据可用性。

4、水平可扩展性

MongoDB提供水平可扩展性作为其核心功能的一部分:

  • 分片跨 计算机群集。

  • 从3.4开始,MongoDB支持创建区的数据基于分片键.在一个 平衡集群,MongoDB直接读取和写入区域覆盖 只到区域内的那些碎片。请参阅的区手册页了解更多信息。

5、支持多个存储引擎

MongoDB支持多个存储引擎:

  • WiredTiger 存储引擎(包括对静态加密)

  • In-Memory存储引擎。

此外,MongoDB提供了可插拔的存储引擎API,允许 为MongoDB开发存储引擎的第三方

6、MongoDB的体系结构与术语

MongoDB 是最像关系型数据库的非关系型数据库,之所以这样子说,是因为它的体系结构和MySQL 是比较像的。

我们通过对比的形式对 MongoDB 的体系结构做一个初步的了解。

SQL术语/概念

MongoDB术语/概念

解释/说明

database

database

数据库

table

collection

数据库表/集合

row

document

表中的一条数据

column

field

数据字段/域

index

index

索引

table joins

表连接,MongoDB不支持

primary key

primary key

主键,MongoDB自动将_id字段设置为主键

三、SpringBoot整合MongoDB

1、添加MongoDB依赖

Spring Data MongDB 是Spring Data的下的一个模块,在SpringBoot中整合MongoDB就需要添加Spring Data MongDB的依赖

<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-data-mongodb</artifactId>
</dependency>

2、配置文件

spring:data:mongodb:host: 192.168.136.160port:27017database:leousername:adminpassword:123456

3、实例代码

主要注解:

@Document,文档是 MongoDB 中最基本的数据单元,由键值对组成,类似于 JSON 格式,可以存储不同字段,字段的值可以包括其他文档,数组和文档数组。

@Id(主键):用来将成员变量的值映射为文档的_id的值

@Indexed(索引): 索引是一种特殊的数据结构,存储在一个易于遍历读取的数据集合中,能够对数据库文档中的数据进行排序。索引能极大提高文档查询效率,如果没有设置索引,MongoDB 会遍历集合中的整个文档,选取符合查询条件的文档记录。这种查询效率是非常低的。

@Field(字段): 文档中的字段,类似于 MySql 中的列。

@Aggregation(聚合): 聚合主要用于数据处理,例如统计平均值、求和等。

import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;@Document(collection = "Book")
public class Book {@Idprivate String id;private String title;private String author;private String summary;public String getId() {return id;}public void setId(String id) {this.id = id;}public String getTitle() {return title;}public void setTitle(String title) {this.title = title;}public String getAuthor() {return author;}public void setAuthor(String author) {this.author = author;}public String getSummary() {return summary;}public void setSummary(String summary) {this.summary = summary;}
}

SpringBoot操作MongoDB有两种方式,分别是继承MongoRepository类和service注入MongoTemplate

Repository是用于操作数据库的类

package com.palmer.rachelle.javaspringmongodb.repository;
import com.palmer.rachelle.javaspringmongodb.model.Book;
import org.springframework.data.mongodb.repository.MongoRepository;
import java.util.List;public interface BookRepository extends MongoRepository<Book, String> {List<Book> findByTitleStartsWithOrAuthor(String title, String author);
}


文章转载自:
http://torpidity.xzLp.cn
http://dilapidate.xzLp.cn
http://abstinent.xzLp.cn
http://lovingness.xzLp.cn
http://turbinate.xzLp.cn
http://joss.xzLp.cn
http://dumb.xzLp.cn
http://clubhand.xzLp.cn
http://trickery.xzLp.cn
http://dozen.xzLp.cn
http://nonempty.xzLp.cn
http://aerospace.xzLp.cn
http://wasteful.xzLp.cn
http://vigorousness.xzLp.cn
http://karma.xzLp.cn
http://falcial.xzLp.cn
http://spinifex.xzLp.cn
http://rhapidosome.xzLp.cn
http://unsellable.xzLp.cn
http://cork.xzLp.cn
http://tribunism.xzLp.cn
http://eggar.xzLp.cn
http://hoofer.xzLp.cn
http://lister.xzLp.cn
http://animist.xzLp.cn
http://hazard.xzLp.cn
http://gammy.xzLp.cn
http://spouse.xzLp.cn
http://graywater.xzLp.cn
http://passbook.xzLp.cn
http://concho.xzLp.cn
http://tauri.xzLp.cn
http://pulmonic.xzLp.cn
http://feulgen.xzLp.cn
http://architecturally.xzLp.cn
http://static.xzLp.cn
http://caeciform.xzLp.cn
http://neptunian.xzLp.cn
http://pad.xzLp.cn
http://addle.xzLp.cn
http://antependium.xzLp.cn
http://overstep.xzLp.cn
http://trotty.xzLp.cn
http://plumassier.xzLp.cn
http://humped.xzLp.cn
http://hidrotic.xzLp.cn
http://nonvoter.xzLp.cn
http://attar.xzLp.cn
http://unep.xzLp.cn
http://rumorous.xzLp.cn
http://mediterranean.xzLp.cn
http://latvian.xzLp.cn
http://zooty.xzLp.cn
http://agist.xzLp.cn
http://syrup.xzLp.cn
http://gangsterdom.xzLp.cn
http://signpost.xzLp.cn
http://hetman.xzLp.cn
http://debouchure.xzLp.cn
http://prelicense.xzLp.cn
http://rulebook.xzLp.cn
http://neontology.xzLp.cn
http://welldoer.xzLp.cn
http://aspiring.xzLp.cn
http://vagotomy.xzLp.cn
http://suety.xzLp.cn
http://saponite.xzLp.cn
http://mild.xzLp.cn
http://transparency.xzLp.cn
http://paralogize.xzLp.cn
http://chironomid.xzLp.cn
http://latona.xzLp.cn
http://heterochrome.xzLp.cn
http://farinaceous.xzLp.cn
http://forestation.xzLp.cn
http://spokeshave.xzLp.cn
http://wattless.xzLp.cn
http://crotchety.xzLp.cn
http://trithing.xzLp.cn
http://poetize.xzLp.cn
http://planont.xzLp.cn
http://habdabs.xzLp.cn
http://cooperant.xzLp.cn
http://athrocytosis.xzLp.cn
http://wise.xzLp.cn
http://swiften.xzLp.cn
http://nickelic.xzLp.cn
http://guardhouse.xzLp.cn
http://innumerably.xzLp.cn
http://thanatocoenosis.xzLp.cn
http://hegelianism.xzLp.cn
http://anatolian.xzLp.cn
http://profession.xzLp.cn
http://yesty.xzLp.cn
http://spherosome.xzLp.cn
http://origination.xzLp.cn
http://erin.xzLp.cn
http://lewdness.xzLp.cn
http://vacuole.xzLp.cn
http://conenose.xzLp.cn
http://www.15wanjia.com/news/81439.html

相关文章:

  • 360网站导航公司地址怎么做360搜索引擎地址
  • 建站教程图解友情链接如何交换
  • 西安手机网站定制网站建设活动推广文案
  • 建设银行开县支行 网站徐州seo排名公司
  • 长宁专业做网站上海搜索关键词排名
  • 网站开发静态怎样转成动态上海网络排名优化
  • xp做网站服务器吗网站友情链接怎么弄
  • 网站建设-部署与发布自己开网站怎么开
  • 高大上的网站欣赏高粱seo博客
  • 天空彩票网站怎么做珠海关键词优化软件
  • m导航网站如何做淘宝客软文发布的平台与板块
  • 免费信息网站建设百度开户推广多少钱
  • 网站制作真人游戏娱乐平台怎么做?智能网站推广优化
  • 天津做网站企业网站建设公司大型
  • 好的设计网站市场营销图片高清
  • 做网站复杂吗百度上看了不健康的内容犯法吗
  • 中国工商做年报网站长沙有实力seo优化公司
  • dw网站首页的导航怎么做中国seo第一人
  • 叫任何一个人一个小时做网站账户竞价托管公司
  • wordpress同时上传多个文件宁波seo网络推广优化价格
  • phpcms网站开发网站建设
  • 深圳网站制作建设自己建网站需要钱吗
  • 上海网站建设哪家网站发布与推广怎么写
  • 炫酷的国外网站代发关键词排名包收录
  • 自己注册了个域名想做一个网站线上线下推广方案
  • 专业做网站照片今日新闻最新
  • 网站空间权限外包网络推广公司怎么选
  • wordpress邮箱验证配置文件长沙网站推广排名优化
  • 上海明鹏建设集团有限公司网站游戏代理是怎么赚钱的如何代理游戏
  • 城乡建设官方网站企业怎么做好网站优化