Filter on Nested Values - Not Contains

Hello All , I have a problem where i need to find a parent document which doesnt have a specific value in any of its nested documents. In below example - i need to ignore this below document if any of its children have status = active. Please suggest how to achieve it. So here , this below document will not be returned as one of its child document has status as active. The positive case is that if all of them are inactive then it will be returned.

For eg , this is one of my document :-

    {
                "_index": "testlinked",
                "_type": "_doc",
                "_id": "6",
                "_score": 1.0,
                "_source": {
                    "Id": "108",
                    "pipe": [
                        {
                            "pipeId": "108",
                            "status": "active"
                        },
                        {
                            "pipeId": "108",
                            "status": "inactive"
                        },
                        {
                            "pipeId": "108",
                            "status": "inactive"
                        }
                    ]
                }
            }

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.