MOngo DB Filter

0

I have the following document break in my collection

{
    "_id" : "908f9ffb-b0b7-f020-381a-d02b75d095e9",
    "messages" : [ 
        {
            "intents" : [],
            "entities" : [],
            "input" : {
                "date" : ISODate("2017-10-03T15:44:00.000Z")
            },
            "output" : {
                "nodes_visited" : [ 
                    "Welcome", 
                    "node_6_1505917506810"
                ],

            }
        }, 
        {
            "intents" : [],
            "entities" : [ ],
            "input" : {
                "date" : ISODate("2017-10-03T16:59:00.000Z")
            },
            "output" : {
                "nodes_visited" : [ 
                    "node_8_1505918850318"
                ],
            }
        }, 
        {
            "intents" : [],
            "entities" : [],
            "input" : {
                "date" : ISODate("2017-10-03T16:59:00.000Z")
            },
            "output" : {
                "nodes_visited" : [ 
                    "Anything else"
                ],
                "log_messages" : [],
                "date" : ISODate("2017-10-03T16:59:00.000Z")
            }

        }
    ],
    "date" : ISODate("2017-10-03T16:44:20.125Z"),

}

I need to know how to return a count how many times "Anything else" exists in messages.output.nodes_visited

    
asked by anonymous 05.04.2018 / 23:05

0 answers