# Check if nested object not exists

**URL:** <https://discuss.elastic.co/t/check-if-nested-object-not-exists/21602>\
**Category:** Elasticsearch\
**Created:** [January 13, 2015, 11:19am UTC](https://discuss.elastic.co/t/check-if-nested-object-not-exists/21602 "2015-01-13T11:19:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Elke](https://avatars.discourse-cdn.com/v4/letter/e/cdc98d/32.png) [@Elke](https://discuss.elastic.co/u/Elke)\
**Post date:** [January 13, 2015, 11:19am UTC](https://discuss.elastic.co/t/check-if-nested-object-not-exists/21602/1 "2015-01-13T11:19:46Z")

</div>

Hello.

I want to check if an document miss a nested object (and the opposite too).  
I want to get all documents which contain a marketplace that does not have  
a price array.  
This is part of my query (there are "and filter" because there can be more  
than one restriction) :

{  
"nested": {  
"filter": {  
"and": {  
"filters": [,{  
"nested": {  
"filter": {  
"and": {  
"filters": [  
{

"not": {

"filter": {

"exists": {

"field": "marketplace.price.id"

}  
}  
}  
}  
]  
}  
},  
"path":  
"marketplace.price"  
}  
}  
]  
}  
},  
"path": "marketplace"  
}  
}

both marketplace and price are mapped : "nested".

I have two marketplaces. One has a price array, one does not have a price  
array. In the same document. With the query above I don't get a hit.

Can someone give me a hint or solution for that problem?

Cheers,  
Elke

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/fd9b38a2-8bd1-4175-ace1-588917056dfc%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/fd9b38a2-8bd1-4175-ace1-588917056dfc%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 12:39am UTC](https://discuss.elastic.co/t/check-if-nested-object-not-exists/21602/2 "2017-07-06T00:39:24Z")

</div>


