# Connect ES with MongoDB

**URL:** https://discuss.elastic.co/t/connect-es-with-mongodb/1074
**Category:** Elasticsearch
**Created:** [May 21, 2015, 10:27am UTC](https://discuss.elastic.co/t/connect-es-with-mongodb/1074 "2015-05-21T10:27:25Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Jean\_Wisser](https://avatars.discourse-cdn.com/v4/letter/j/eb9ed0/32.png) [@Jean\_Wisser](https://discuss.elastic.co/u/Jean_Wisser)
#### Post date: [May 21, 2015, 10:27am UTC](https://discuss.elastic.co/t/connect-es-with-mongodb/1074/1 "2015-05-21T10:27:25Z")

</div>

Since river will be deprecated, what is the best way to index files from mongo db into elasticsearch ?

I heard that here is a plugin for logstash but is it the best way ?

Thanks,  
Jean.

---

<div class="post-metadata">

### Author: ![Sarwar](https://avatars.discourse-cdn.com/v4/letter/s/7c8e57/32.png) [@Sarwar](https://discuss.elastic.co/u/Sarwar)
#### Post date: [May 21, 2015, 2:50pm UTC](https://discuss.elastic.co/t/connect-es-with-mongodb/1074/2 "2015-05-21T14:50:36Z")

</div>

I'd imagine first you have to decide what you want to store in Elasticsearch and at what points you get that from Mongodb (on writes? in bulk?). Once you know, there might be a small bit of coding you do on your application or script to generate events and push to something like a message broker from which logstash can grab and push to Elasticsearch. Or you may find just using one of the support Elasticsearch client libraries may do the trick.

Sarwar

---

<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:12am UTC](https://discuss.elastic.co/t/connect-es-with-mongodb/1074/3 "2017-07-06T00:12:39Z")

</div>


