当前位置:网站首页>Possible pits in mongodb project
Possible pits in mongodb project
2022-06-23 06:13:00 【aishivge】
If you need to insert latitude and longitude , And use related functions , You need to create a location index
Can’t extract geo {$set:{ location: [ 13.42493130000003, 52.50074619999999 ]}}
May be lat and lon The position is reversed
Due to limitations of the com.mongodb.BasicDBObject, you can’t add a second
At the same time and and or
situation 1:
Query query=new Query();
query.addCriteria(new Criteria().andOperator(xxxx))
query.addCriteria(new Criteria().orOperator(xxxx))
Change it to
query.addCriteria(new Criteria().andOperator(xxxx).orOperator(xxxx))
situation 2:
query.addCriteria(Criteria.where(“paidTime”).gte(startTimeStamp))
query.addCriteria(Criteria.where(“paidTime”).lt(endTimeStamp))
Change it to :
query.addCriteria(new Criteria().andOperator(
Criteria.where(“paidTime”).gte(startTimeStamp),
Criteria.where(“paidTime”).lt(endTimeStamp)
))
);
perhaps
query.addCriteria(new Criteria().andOperator(
Criteria.where(“paidTime”).gte(startTimeStamp).lt(endTimeStamp)
))
);
mongodb state should be: ClientSession from same MongoClient
mongoTemplate in Of MongoClient It should be the same
With a transaction Prompt when inserting data
Cannot create namespace xxx.xxx in multi-document transaction.
non-existent collection You need to create , Insert any data
Reference resources
https://www.cnblogs.com/flipped/p/12972409.html
边栏推荐
- 十一、纺织面料下架功能的实现
- jvm-01.指令重排
- Efficient office of fintech (I): automatic generation of trust plan specification
- jvm-02.有序性保证
- Android handler memory leak kotlin memory leak handling
- Centos7部署radius服务-freeradius-3.0.13-15.el7集成mysql
- Runc symbolic link mount and container escape vulnerability alert (cve-2021-30465)
- Design scheme of Small PLC based on t5l1
- [focus on growth and build a dream for the future] - TDP year-end event, three chapters go to the Spring Festival!
- 如何指定pig-register项目日志的输出路径
猜你喜欢

微软面试题:打印折纸的折痕

三项最高级认证,两项创新技术、两大优秀案例,阿里云亮相云原生产业大会

ant使用总结(三):批量打包apk

True MySQL interview question (XXII) -- condition screening and grouping screening after table connection

How to query fields separated by commas in MySQL as query criteria - find_ in_ Set() function

gplearn出现 assignment destination is read-only

Real MySQL interview questions (25) -- common group comparison scenarios

Runc symbolic link mount and container escape vulnerability alert (cve-2021-30465)

【Vivado那些事儿】XilinxCEDStore介绍

jvm-01.指令重排
随机推荐
Difference between MySQL read committed and repeatability
Pat class B 1014 C language
Kotlin collaboration +retro most elegant network request use
True MySQL interview question (21) - Finance - overdue loan
How to add libraries for Arduino ide installation
求二叉树最宽的层有多少个节点
【Cocos2d-x】可擦除的Layer:ErasableLayer
Pit filling for abandoned openssl-1.0.2 (.A to.So)
Runc symbolic link mount and container escape vulnerability alert (cve-2021-30465)
SQL表名与函数名相同导致SQL语句错误。
jvm-03. JVM memory model
How to query fields separated by commas in MySQL as query criteria - find_ in_ Set() function
【Leetcode】431. Encode N-ary Tree to Binary Tree(困难)
金融科技之高效办公(一):自动生成信托计划说明书
The traditional Internet like platform may no longer exist, and a new industry integrating industrial characteristics and Internet characteristics
内存分析与内存泄漏检测
Pat class B 1016 C language
Kotlin interface
jvm-02. Guarantee of orderliness
Matplotlib savefig multiple picture overlay