Due to limitations of the com.mongodb.BasicDocument, you can‘t add a second ‘_id‘ criteria. Query al

本文涉及的产品
云数据库 MongoDB,通用型 2核4GB
简介: Due to limitations of the com.mongodb.BasicDocument, you can‘t add a second ‘_id‘ criteria. Query al
//正确写法
Query query = new Query();
    Criteria criteria = new Criteria();
    query.addCriteria(criteria.where("_id").in(openDayStatus.getIds()).and("status").is(openDayStatus.getStatus()));
    List<CustomFormMongoEntity> entityList = mongoTemplate.find(query, CustomFormMongoEntity.class, MongoUtils.getTenantCollName(ParentPrivateController.COLLECTION_NAME));

 

相关实践学习
MongoDB数据库入门
MongoDB数据库入门实验。
快速掌握 MongoDB 数据库
本课程主要讲解MongoDB数据库的基本知识,包括MongoDB数据库的安装、配置、服务的启动、数据的CRUD操作函数使用、MongoDB索引的使用(唯一索引、地理索引、过期索引、全文索引等)、MapReduce操作实现、用户管理、Java对MongoDB的操作支持(基于2.x驱动与3.x驱动的完全讲解)。 通过学习此课程,读者将具备MongoDB数据库的开发能力,并且能够使用MongoDB进行项目开发。 &nbsp; 相关的阿里云产品:云数据库 MongoDB版 云数据库MongoDB版支持ReplicaSet和Sharding两种部署架构,具备安全审计,时间点备份等多项企业能力。在互联网、物联网、游戏、金融等领域被广泛采用。 云数据库MongoDB版(ApsaraDB for MongoDB)完全兼容MongoDB协议,基于飞天分布式系统和高可靠存储引擎,提供多节点高可用架构、弹性扩容、容灾、备份回滚、性能优化等解决方案。 产品详情: https://www.aliyun.com/product/mongodb
相关文章
|
4月前
simple-query
simple-query
23 0
|
5月前
|
NoSQL MongoDB
解决 :MongoDB couldn‘t add user: not authorized on ‘your db‘ to execute command
解决 :MongoDB couldn‘t add user: not authorized on ‘your db‘ to execute command
136 0
|
Oracle 关系型数据库 数据库
Oracle 报错:exceeded simultaneous SESSIONS_PER_USER limit
Oracle 报错:exceeded simultaneous SESSIONS_PER_USER limit
Oracle 报错:exceeded simultaneous SESSIONS_PER_USER limit
|
SQL 关系型数据库 MySQL
mysql 报错 is too long for user name (should be no longer than 16)
mysql 报错 is too long for user name (should be no longer than 16)
238 0
|
关系型数据库 数据库 PostgreSQL
postgresql :ERROR: role “user001“ cannot be dropped because some objects depend on it
postgresql :ERROR: role “user001“ cannot be dropped because some objects depend on it
645 0
PAT (Advanced Level) Practice - 1119 Pre- and Post-order Traversals(30 分)
PAT (Advanced Level) Practice - 1119 Pre- and Post-order Traversals(30 分)
106 0
PAT (Advanced Level) Practice - 1119 Pre- and Post-order Traversals(30 分)
|
SQL 关系型数据库 MySQL
Influx Sql系列教程四:series/point/tag/field
influxdb中的一条记录point,主要可以分为三类,必须存在的time(时间),string类型的tag,以及其他成员field;而series则是一个measurement中保存策略和tag集构成;
308 0
How SAP concrete schema id is got based on transaction type plus catalog type
How SAP concrete schema id is got based on transaction type plus catalog type
100 0
How SAP concrete schema id is got based on transaction type plus catalog type
How to trace Product search UI transaction using SAT - In Parallel Session
How to trace Product search UI transaction using SAT - In Parallel Session
125 0
delete in ST05 trace - deletion will also lead to many DB access first
delete in ST05 trace - deletion will also lead to many DB access first
102 0
delete in ST05 trace - deletion will also lead to many DB access first