【发布时间】:2020-01-21 08:37:32
【问题描述】:
db.getCollection('parentCollection').find({"mapObject.someField" : {$exists: true}})
我希望将其转换为如下方法 .
@Query("{mapObject.someField :{$exists : true}}")
List<Parent> findByMapKey(String id);
运行应用程序时出现空指针异常
@Query("{mapObject.someField :{$exists : true}}")
here someField needs to be dynamic not fixed so i want my id to be passed in place of someField
这里也存在同样的问题 How to get parent object based upon key from child map in MongoRepository JAVA SpringBoot
【问题讨论】:
标签: java mongodb mongodb-query