## pom.xml依賴
```
<!-- MongoDB -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-mongodb</artifactId>
</dependency>
<!-- spring Mongo配置 包 -->
<dependency>
<groupId>com.spring4all</groupId>
<artifactId>mongodb-plus-spring-boot-starter</artifactId>
<version>1.0.0.RELEASE</version>
</dependency>
```
## application.properties常用配置
```
#MongoDB
spring.data.mongodb.database=test
spring.data.mongodb.host=127.0.0.1
spring.data.mongodb.port=27017
#配置MongoTemplate日志
logging.level.org.springframework.data.mongodb.core.MongoTemplate=DEBUG
```
## 更多配置說明
```
#mongo配置
#mongo服務的端口號
spring.data.mongodb.port=27017
#mongo服務的地址
spring.data.mongodb.host=xxxxxx
#mongo服務的登錄名稱
spring.data.mongodb.username=xxxxx
#mongo服務的密碼
spring.data.mongodb.password=xxxxxxx
#此人的驗證數據庫
spring.data.mongodb.authentication-database=xxxxxxxx
#待連接數據庫
spring.data.mongodb.database=xxxxxxxx
#mongo最大的池子數
spring.data.mongodb.option.max-connection-per-host=100
#設置允許阻塞等待連接的線程數的乘數。
spring.data.mongodb.option.threads-allowed-to-block-for-connection-multiplier=5
#套接字選擇超時時間
spring.data.mongodb.option.server-selection-timeout=30000
#最大等待時間
spring.data.mongodb.option.max-wait-time=120000
#池化連接的最大空閑時間。零值表示空閑時間沒有限制。超出其空閑時間的池化連接將被關閉,并在必要時由新連接替換。
spring.data.mongodb.option.max-connection-idle-time=300000
#服務器斷開時間
spring.data.mongodb.option.max-connection-idle-time=300000
#連接超時實際那
spring.data.mongodb.option.connect-timeout=10000
# 設置套接字超時
spring.data.mongodb.option.socket-timeout=0
#會話一直存在的會引發socket異常
spring.data.mongodb.option.socket-keep-alive=false
#設置啟用SSL
spring.data.mongodb.option.ssl-enabled=false
#定義是否允許使用無效的主機名。
spring.data.mongodb.option.ssl-invalid-host-name-allowed=false
#設置驅動程序注冊的JMX bean是否應始終為MBean,無論VM是Java還是更高版本。
spring.data.mongodb.option.always-use-m-beans=false
#設置用于群集心跳的連接的套接字超時。
spring.data.mongodb.option.heartbeat-socket-timeout=20000
#設置用于群集心跳的連接的連接超時。
spring.data.mongodb.option.heartbeat-connect-timeout=20000
#設置最小心跳頻率。如果驅動程序必須經常重新檢查服務器的可用性,它將至少在上一次檢查后等待很長時間,以避免浪費精力。默認值為500毫秒。
spring.data.mongodb.option.min-heartbeat-frequency=500
#設置心跳頻率。這是驅動程序將嘗試確定群集中每個服務器的當前狀態的頻率。默認值為10,000毫秒
spring.data.mongodb.option.heartbeat-frequency=10000
#可配置默認值為15毫秒
spring.data.mongodb.option.local-threshold=15
```
- JDK常用知識庫
- JDK各個版本安裝
- Java8流
- 算法
- 十大排序算法
- 冒泡排序
- 選擇排序
- 插入排序
- 歸并排序
- 快速排序
- 堆排序
- 希爾排序
- 計數排序
- 桶排序
- 基數排序
- 總結
- 常用工具類
- 浮點型計算
- 時間格式處理
- 常用功能點思路整理
- 登錄
- 高并發
- 線程安全的單例模式
- Tomcat優化
- Tomcat之APR模式
- Tomcat啟動過慢問題
- 常用的數據庫連接池
- Druid連接池
- 緩存
- Redis
- SpringBoot整合Redis
- 依賴和配置
- RedisTemplate工具類
- 工具類使用方法
- Redis知識庫
- Redis安裝
- Redis配置參數
- Redis常用Lua腳本
- MongoDB
- SpringBoot操作MongoDB
- 依賴和配置
- MongoDB工具類
- 工具類使用方法
- 消息中間件
- ActiveMq
- SpringBoot整合ActiveMq
- 框架
- SpringBoot
- 定時任務
- 啟動加載
- 事務
- JSP
- 靜態類注入
- SpringSecurity
- Shiro
- 配置及整合
- 登陸驗證
- 權限驗證
- 分布式應用
- SpringMVC
- ORM框架
- Mybatis
- 增
- 刪
- 改
- 查
- 程序員小笑話
- 我給你講一個TCP的笑話吧
- 二進制笑話
- JavaScript的那點東西
- JavaScript內置對象及常見API詳細介紹
- JavaScript實現Ajax 資源請求
- JavaScript干貨
- 架構師成長之路
- JDK源碼解析
- ArrayList源碼解讀
- 設計模式
- 微服務架構設計模式
- 逃離單體煉獄
- 服務的拆分策略
- 全面解析SpringMvc框架
- 架構設計的六大原則
- 并發集合
- JUC并發編程
- 搜索引擎
- Solr
- Solr的安裝
- 分布式服務框架
- Dubbo
- 從零開始學HTMl
- 第一章-初識HTML
- 第二章-認識HTML標簽