How do I get the value from the ArrayOfObjects dynamically in MongoDB document with Java driver

Viewed 28

I have got a below document in Mongodb collection , need to get the value of result of false with Java syntax .Any help can be appreciated .

    { 
    "_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" : true
            }
        }
{
            "CRaft" : {
                "System" : "Craft", 
                "result" : false
            }
        }
    ], 

I can't go like Email Systems.Bob.result ,Email Systems.Wild.result,Email Systems.Craft.result .Can anyone suggest how to get the result value from all systems with Java synatax.

0 Answers
Related