摘要:
一、说明 mongodb支持Decimal128不支持BigDecimal类型字段,需要自定义转化。 二、创建BigDecimal转化Decimal128 import org.bson.types.Decimal128; import org.springframework.core.conver 阅读全文
posted @ 2023-05-04 17:00
薛大坑
阅读(557)
评论(0)
推荐(0)
摘要:
一、引用mongoTemplate @Resource private MongoTemplate mongoTemplate; 二、分页查询 public void testPage() { int pageNum = 1; int pageSize = 10; // 添加查询条件 Criteri 阅读全文
posted @ 2023-05-04 16:49
薛大坑
阅读(303)
评论(0)
推荐(0)
摘要:
一、事务说明 1、在4.0版本中,MongoDB支持副本集上的多文档事务,分片集群是不支持事务的,会报以下异常 Transactions are not supported by the MongoDB cluster to which this client is connected 2、在版本4 阅读全文
posted @ 2023-05-04 15:59
薛大坑
阅读(1715)
评论(0)
推荐(0)
摘要:
一、添加maven依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-mongodb</artifactId> <version>2.6.7</version 阅读全文
posted @ 2023-05-04 15:31
薛大坑
阅读(240)
评论(0)
推荐(0)