当前位置:网站首页>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-03.jvm内存模型
- Explanation of penetration test process and methodology (Introduction to web security 04)
- Paper notes: multi label learning lsml
- Pat class B 1010 C language
- Excel sheet column number for leetcode topic resolution
- Pyinstaller 打包pyttsx3 出错
- (1) Basic learning - Common shortcut commands of vim editor
- Pit filling for abandoned openssl-1.0.2 (.A to.So)
- Pat class B 1012 C language
- ant使用总结(三):批量打包apk
猜你喜欢

Layer 2技术方案进展情况

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

Real MySQL interview questions (XXVI) -- didi 2020 written examination questions

jvm-01.指令重排

Day_13 传智健康项目-第13章

Ant Usage Summary (II): description of related commands

金融科技之高效办公(一):自动生成信托计划说明书

【Leetcode】431. Encode N-ary Tree to Binary Tree(困难)

mongodb 4.x绑定多个ip启动报错

Adnroid activity screenshot save display to album view display picture animation disappear
随机推荐
【DaVinci Developer专题】-42-如何生成APP SWC的Template和Header文件
[Stanford Jiwang cs144 project] lab2: tcpreceiver
WordPress aawp 3.16 cross site scripting
How to query fields separated by commas in MySQL as query criteria - find_ in_ Set() function
Basic calculator II for leetcode topic analysis
Adnroid activity screenshot save display to album view display picture animation disappear
ant使用总结(三):批量打包apk
Pat class B 1023 minimum decimals
【Leetcode】431. Encode N-ary Tree to Binary Tree(困难)
Fraction to recursing decimal
[cocos2d-x] screenshot sharing function
Multiple strings for leetcode topic resolution
jvm-01. Instruction rearrangement
十一、纺织面料下架功能的实现
matplotlib savefig多个图片叠加问题
Learning Tai Chi Maker - esp8226 (11) distribution network with WiFi manager Library
Kotlin interface
论文笔记: 多标签学习 LSML
Causes and methods of exe flash back
Day_12 传智健康项目-JasperReports