如何用Java语法获取MongoDB的ArrayOfObjects中的一个字段的值
我有以下的收藏如何用Java语法获取MongoDB的ArrayOfObjects中的一个字段的值,mongodb,spring-boot,rest,aggregation-framework,Mongodb,Spring Boot,Rest,Aggregation Framework,我有以下的收藏 { "_id" : ObjectId("5f0890e870e631865877e"), "user" : "testuser", "Email" : "testuser@sample.com", "Batch Systems" : [ "STAR", "STORY",
{
"_id" : ObjectId("5f0890e870e631865877e"),
"user" : "testuser",
"Email" : "testuser@sample.com",
"Batch Systems" : [
"STAR",
"STORY",
"ITEMS",
],
"Email Systems" : [
{
"Bob" : {
"System" : "Bob",
**"result"** : true
}
},
{
"Wild" : {
"System" : "Wild",
"result" : false
}
}
],
我需要从上面的MongoDB文档中获取结果值。如果“result:false”字段。需要添加值作为响应。我尝试了以下语法,但没有成功。有人能帮我学习Java语法吗
String searchString =new String("false");
List<Document> pipeline = Arrays.asList(
new Document("$project",
new Document("Claim Systems",
new Document("$match",
new Document("$Email Systems.Bob.result",false)
))));
List<Document> pipeline = Arrays.asList(
new Document("$project",
new Document("Claim Systems",
new Document("$match",
new Document("$Email Systems.Bob.result",false),
new Document("$match" ,
new Document( "$Email Systems.Wild.result",false
))));
"Email Systems" : [
{
"Bob" : {
"System" : "Bob",
**"result"** : true
}
},
{
"Wild" : {
"System" : "Wild",
"result" : false
}
}
{
"star" : {
"System" : "star",
"result" : false
}
}
],