英文:
Getting issue Upgrading from Mongo driver version 3.8.1 to 4.6.1
问题
在将Mongo驱动程序版本从3.8.1升级到4.6.1后,我的现有查询中出现了以下错误:
"未识别的管道阶段名称:'$and'"
以前所有的聚合都是有效的。
Spring Boot版本 - 2.7.10
Java版本 - 11
如果我将版本从4.6.1还原到3.8.1,我会得到未定义的类错误。请帮助我解决这个问题。
英文:
After updating the mongo driver version from 3.8.1 to 4.6.1. I am getting below error in my existing queries
"Unrecognized pipeline stage name: '$and'"
All the aggregations were working Earlier.
Spring boot version - 2.7.10
Java version - 11
If I revert the version from 4.6.1 to 3.8.1, I get class not defined error. Pls help me in resolving this issue
答案1
得分: 0
问题出在匹配管道上,它添加了两次 "and",但在先前的版本中运行良好,但在使用新版本时出现问题。我修改了以下代码:
改用这个:
pipeline.addAll
英文:
The issue was with the Match Pipeline , it was adding and two times but it was working fine in previous version biut breaking when we were using the new verison. I modified the below code :
Instead of this
pipeline.add(and
Use this:
pipeline.addAll
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论