# Delete document without id?

**URL:** https://discuss.elastic.co/t/delete-document-without-id/62844
**Category:** Elasticsearch
**Created:** [October 12, 2016, 6:12pm UTC](https://discuss.elastic.co/t/delete-document-without-id/62844 "2016-10-12T18:12:19Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![YeeP](https://avatars.discourse-cdn.com/v4/letter/y/41988e/32.png) [@YeeP](https://discuss.elastic.co/u/YeeP)
#### Post date: [October 12, 2016, 6:12pm UTC](https://discuss.elastic.co/t/delete-document-without-id/62844/1 "2016-10-12T18:12:19Z")

</div>

So my current code to delete some specific "documents" is failing. I get a message that:

> Unable to build a path with those params. Supply at least index, type, id

I have elasticsearch creating my ids for me, so I don't really know what they are. The only way I can come up with knowing them, is to query with the criteria I am trying to use for the delete, and create an array of ids then use that array to delete specific ids. Is that the only way to get this done? Here is a snippit of the code I am attempting right now (not working). Note: the date field is a string, not a timestamp.

```
elastic.delete({
                index: MONTHLY_SUMMARY_INDEX,
                type: "object",
                body: {
                    query: {
                        match: {
                            date: namedMonthYear
                        }
                    }
                }
            }).then(function(res) {

```

---

<div class="post-metadata">

### Author: ![ywelsch](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ywelsch/32/7751_2.png) [@ywelsch](https://discuss.elastic.co/u/ywelsch)
#### Post date: [October 12, 2016, 8:38pm UTC](https://discuss.elastic.co/t/delete-document-without-id/62844/2 "2016-10-12T20:38:22Z")

</div>

The delete-by-query plugin will help:

[https://www.elastic.co/guide/en/elasticsearch/plugins/current/delete-by-query-usage.html](https://www.elastic.co/guide/en/elasticsearch/plugins/current/delete-by-query-usage.html)

---

<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 5, 2017, 10:12pm UTC](https://discuss.elastic.co/t/delete-document-without-id/62844/3 "2017-07-05T22:12:52Z")

</div>


