# MongoDB River Plugin for ElasticSearch

**URL:** <https://discuss.elastic.co/t/mongodb-river-plugin-for-elasticsearch/6540>\
**Category:** Elasticsearch\
**Created:** [January 30, 2012, 4:34pm UTC](https://discuss.elastic.co/t/mongodb-river-plugin-for-elasticsearch/6540 "2012-01-30T16:34:24Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Richard\_Louapre](https://avatars.discourse-cdn.com/v4/letter/r/e19adc/32.png) [@Richard\_Louapre](https://discuss.elastic.co/u/Richard_Louapre)\
**Post date:** [January 30, 2012, 4:34pm UTC](https://discuss.elastic.co/t/mongodb-river-plugin-for-elasticsearch/6540/1 "2012-01-30T16:34:24Z")

</div>

Hi,

You can find [0] a first implementation of MongoDB plugin for ES.

This version has the following features:

- Monitoring MongoDB using oplog.rs collection.
- Support for GridFS.

Please check the wiki [1] for more details.

[0] - [https://github.com/richardwilly98/elasticsearch-river-mongodb](https://github.com/richardwilly98/elasticsearch-river-mongodb)  
[1] - [https://github.com/richardwilly98/elasticsearch-river-mongodb/wiki](https://github.com/richardwilly98/elasticsearch-river-mongodb/wiki)

Thanks,  
Richard.

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [January 31, 2012, 3:50pm UTC](https://discuss.elastic.co/t/mongodb-river-plugin-for-elasticsearch/6540/2 "2012-01-31T15:50:05Z")

</div>

Thanks!

On Monday, January 30, 2012 at 6:34 PM, Richard Louapre wrote:

> Hi,
> 
> You can find [0] a first implementation of MongoDB plugin for ES.
> 
> This version has the following features:
> 
> - Monitoring MongoDB using oplog.rs collection.
> - Support for GridFS.
> 
> Please check the wiki [1] for more details.
> 
> [0] - [GitHub - richardwilly98/elasticsearch-river-mongodb: MongoDB River Plugin for ElasticSearch](https://github.com/richardwilly98/elasticsearch-river-mongodb)  
> [1] - [Home · richardwilly98/elasticsearch-river-mongodb Wiki · GitHub](https://github.com/richardwilly98/elasticsearch-river-mongodb/wiki)
> 
> Thanks,  
> Richard.

---

<div class="post-metadata">

**Author:** ![Yammi](https://avatars.discourse-cdn.com/v4/letter/y/ed8c4c/32.png) [@Yammi](https://discuss.elastic.co/u/Yammi)\
**Post date:** [February 1, 2012, 11:42am UTC](https://discuss.elastic.co/t/mongodb-river-plugin-for-elasticsearch/6540/3 "2012-02-01T11:42:27Z")

</div>

WHOOT!

Thank god this exists.

On Jan 30, 11:34 am, Richard Louapre [richard.loua...@gmail.com](mailto:richard.loua...@gmail.com)  
wrote:

> Hi,
> 
> You can find [0] a first implementation of MongoDB plugin for ES.
> 
> This version has the following features:
> 
> - Monitoring MongoDB using oplog.rs collection.
> - Support for GridFS.
> 
> Please check the wiki [1] for more details.
> 
> [0] -[GitHub - richardwilly98/elasticsearch-river-mongodb: MongoDB River Plugin for ElasticSearch](https://github.com/richardwilly98/elasticsearch-river-mongodb)  
> [1] -[Home · richardwilly98/elasticsearch-river-mongodb Wiki · GitHub](https://github.com/richardwilly98/elasticsearch-river-mongodb/wiki)
> 
> Thanks,  
> Richard.

---

<div class="post-metadata">

**Author:** ![Arny](https://avatars.discourse-cdn.com/v4/letter/a/8dc957/32.png) [@Arny](https://discuss.elastic.co/u/Arny)\
**Post date:** [February 8, 2012, 4:21am UTC](https://discuss.elastic.co/t/mongodb-river-plugin-for-elasticsearch/6540/4 "2012-02-08T04:21:10Z")

</div>

Hi,

is the river tracking updates on documents inside mongodb as well?

On 30 Jan., 17:34, Richard Louapre [richard.loua...@gmail.com](mailto:richard.loua...@gmail.com) wrote:

> Hi,
> 
> You can find [0] a first implementation ofMongoDBplugin for ES.
> 
> This version has the following features:
> 
> - MonitoringMongoDBusing oplog.rs collection.
> - Support for GridFS.
> 
> Please check the wiki [1] for more details.
> 
> [0] -[GitHub - richardwilly98/elasticsearch-river-mongodb: MongoDB River Plugin for ElasticSearch](https://github.com/richardwilly98/elasticsearch-river-mongodb)  
> [1] -[Home · richardwilly98/elasticsearch-river-mongodb Wiki · GitHub](https://github.com/richardwilly98/elasticsearch-river-mongodb/wiki)
> 
> Thanks,  
> Richard.

---

<div class="post-metadata">

**Author:** ![Arny](https://avatars.discourse-cdn.com/v4/letter/a/8dc957/32.png) [@Arny](https://discuss.elastic.co/u/Arny)\
**Post date:** [February 8, 2012, 8:06pm UTC](https://discuss.elastic.co/t/mongodb-river-plugin-for-elasticsearch/6540/5 "2012-02-08T20:06:26Z")

</div>

I don't know if I'm missing something, but I can't get this to work.

1. I've set up an replica with just 1 node for test purposes.
2. Installed the river just like in docs stated.
3. Add an document to mongodb

But, nothing happens?  
I don't see any exceptions or anything that would show a failure.

I'm using Java API to set up the river:  
this.esNode = NodeBuilder.nodeBuilder()  
.settings(ImmutableSettings.settingsBuilder().put("gateway.type",  
"local")).node();

```
	// mongodb river index
	XContentBuilder json;
	try {
		json = jsonBuilder()
				.startObject()
					.field("type", "mongodb")
					.field("mongodb").startObject()
						.field("db", "test")
						.field("collection", "test")
					.endObject()
					.field("index").startObject()
						.field("name", "testname")
						.field("type", "testtype")
					.endObject()
				.endObject();

		this.esNode.client().prepareIndex("_river", "mongodb",

```

"\_meta").setSource(json).execute();

On Jan 30, 5:34 pm, Richard Louapre [richard.loua...@gmail.com](mailto:richard.loua...@gmail.com)  
wrote:

> Hi,
> 
> You can find [0] a first implementation of MongoDB plugin for ES.
> 
> This version has the following features:
> 
> - Monitoring MongoDB using oplog.rs collection.
> - Support for GridFS.
> 
> Please check the wiki [1] for more details.
> 
> [0] -[GitHub - richardwilly98/elasticsearch-river-mongodb: MongoDB River Plugin for ElasticSearch](https://github.com/richardwilly98/elasticsearch-river-mongodb)  
> [1] -[Home · richardwilly98/elasticsearch-river-mongodb Wiki · GitHub](https://github.com/richardwilly98/elasticsearch-river-mongodb/wiki)
> 
> Thanks,  
> Richard.

---

<div class="post-metadata">

**Author:** ![Arny](https://avatars.discourse-cdn.com/v4/letter/a/8dc957/32.png) [@Arny](https://discuss.elastic.co/u/Arny)\
**Post date:** [February 8, 2012, 8:23pm UTC](https://discuss.elastic.co/t/mongodb-river-plugin-for-elasticsearch/6540/6 "2012-02-08T20:23:46Z")

</div>

Ok, my bad.  
I've switched to ES RC1 while the plugin was still using 0.18.5.  
So I've updated all the changes and now everything seems to work.

Thanks for the river 😉

On Feb 8, 9:06 pm, Arny [arny...@googlemail.com](mailto:arny...@googlemail.com) wrote:

> I don't know if I'm missing something, but I can't get this to work.
> 
> 1. I've set up an replica with just 1 node for test purposes.
> 2. Installed the river just like in docs stated.
> 3. Add an document to mongodb
> 
> But, nothing happens?  
> I don't see any exceptions or anything that would show a failure.
> 
> I'm using Java API to set up the river:  
> this.esNode = NodeBuilder.nodeBuilder()  
> .settings(ImmutableSettings.settingsBuilder().put("gateway.type",  
> "local")).node();
> 
> ```
> // mongodb river index
> XContentBuilder json;
> try {
> json = jsonBuilder()
> .startObject()
> .field("type", "mongodb")
> .field("mongodb").startObject()
> .field("db", "test")
> .field("collection", "test")
> .endObject()
> .field("index").startObject()
> .field("name", "testname")
> .field("type", "testtype")
> .endObject()
> .endObject();
> 
> this.esNode.client().prepareIndex("_river", "mongodb",
> 
> ```
> 
> "\_meta").setSource(json).execute();
> 
> On Jan 30, 5:34 pm, Richard Louapre [richard.loua...@gmail.com](mailto:richard.loua...@gmail.com)  
> wrote:
> 
> > Hi,
> 
> > You can find [0] a first implementation of MongoDB plugin for ES.
> 
> > This version has the following features:
> > 
> > - Monitoring MongoDB using oplog.rs collection.
> > - Support for GridFS.
> 
> > Please check the wiki [1] for more details.
> 
> > [0] -[GitHub - richardwilly98/elasticsearch-river-mongodb: MongoDB River Plugin for ElasticSearch](https://github.com/richardwilly98/elasticsearch-river-mongodb)  
> > [1] -[Home · richardwilly98/elasticsearch-river-mongodb Wiki · GitHub](https://github.com/richardwilly98/elasticsearch-river-mongodb/wiki)
> 
> > Thanks,  
> > Richard.

---

<div class="post-metadata">

**Author:** ![Arny](https://avatars.discourse-cdn.com/v4/letter/a/8dc957/32.png) [@Arny](https://discuss.elastic.co/u/Arny)\
**Post date:** [February 17, 2012, 6:06pm UTC](https://discuss.elastic.co/t/mongodb-river-plugin-for-elasticsearch/6540/7 "2012-02-17T18:06:01Z")

</div>

@Richard

seems like partial updates, like increment are not supported now?  
Logs on this

> Cannot get object id. Skip the current item: [{$set={ "userLikesCount" : 1}, \_id=null}]  
> Oplog do not contain \_id inside "o", but there is "o2" which contains  
> the \_id of the document.

Do you think you could fix this?  
Thanks

On Jan 30, 5:34 pm, Richard Louapre [richard.loua...@gmail.com](mailto:richard.loua...@gmail.com)  
wrote:

> Hi,
> 
> You can find [0] a first implementation of MongoDB plugin for ES.
> 
> This version has the following features:
> 
> - Monitoring MongoDB using oplog.rs collection.
> - Support for GridFS.
> 
> Please check the wiki [1] for more details.
> 
> [0] -[GitHub - richardwilly98/elasticsearch-river-mongodb: MongoDB River Plugin for ElasticSearch](https://github.com/richardwilly98/elasticsearch-river-mongodb)  
> [1] -[Home · richardwilly98/elasticsearch-river-mongodb Wiki · GitHub](https://github.com/richardwilly98/elasticsearch-river-mongodb/wiki)
> 
> Thanks,  
> Richard.

---

<div class="post-metadata">

**Author:** ![Richard\_Louapre](https://avatars.discourse-cdn.com/v4/letter/r/e19adc/32.png) [@Richard\_Louapre](https://discuss.elastic.co/u/Richard_Louapre)\
**Post date:** [March 4, 2012, 11:47am UTC](https://discuss.elastic.co/t/mongodb-river-plugin-for-elasticsearch/6540/8 "2012-03-04T11:47:24Z")

</div>

Hi,

I have created a new issue [0]. I will look at it.

[0] -

> <https://github.com/richardwilly98/elasticsearch-river-mongodb/issues/3>
>
> @Richard 
> 
> seems like partial updates, like increment are not supported now? 
> Lo…gs on this 
> 
> \> Cannot get object id. Skip the current item: \[{$set={ "userLikesCount" : 1}, \_id=null}\] 
> \> Oplog do not contain \_id inside "o", but there is "o2" which contains 
> \> the \_id of the document. 
> 
> Do you think you could fix this? 
> Thanks

Ciao,  
Richard.

On Friday, February 17, 2012 1:06:01 PM UTC-5, Arny wrote:

> @Richard
> 
> seems like partial updates, like increment are not supported now?  
> Logs on this
> 
> > Cannot get object id. Skip the current item: [{$set={ "userLikesCount" :  
> > 1}, \_id=null}]  
> > Oplog do not contain \_id inside "o", but there is "o2" which contains  
> > the \_id of the document.
> 
> Do you think you could fix this?  
> Thanks
> 
> On Jan 30, 5:34 pm, Richard Louapre [richard.loua...@gmail.com](mailto:richard.loua...@gmail.com)  
> wrote:
> 
> > Hi,
> > 
> > You can find [0] a first implementation of MongoDB plugin for ES.
> > 
> > This version has the following features:
> > 
> > - Monitoring MongoDB using oplog.rs collection.
> > - Support for GridFS.
> > 
> > Please check the wiki [1] for more details.
> > 
> > [0] -[GitHub - richardwilly98/elasticsearch-river-mongodb: MongoDB River Plugin for ElasticSearch](https://github.com/richardwilly98/elasticsearch-river-mongodb)  
> > [1] -[Home · richardwilly98/elasticsearch-river-mongodb Wiki · GitHub](https://github.com/richardwilly98/elasticsearch-river-mongodb/wiki)
> > 
> > Thanks,  
> > Richard.

---

<div class="post-metadata">

**Author:** ![orenmazor](https://avatars.discourse-cdn.com/v4/letter/o/b782af/32.png) [@orenmazor](https://discuss.elastic.co/u/orenmazor)\
**Post date:** [March 7, 2012, 9:26pm UTC](https://discuss.elastic.co/t/mongodb-river-plugin-for-elasticsearch/6540/9 "2012-03-07T21:26:35Z")

</div>

awesome! I'm excited to stop using my homerolled oplog follower  
([GitHub - orenmazor/elastic-search-loves-mongo](https://github.com/orenmazor/elastic-search-loves-mongo) …slightly out of  
date now).

can I use this to give weight to different ops? my current problem is that  
my delete and index activity is pretty equally high, and I'd like to  
prioritze indexing over delete (i.e. I'm currently modifying my oplog  
follower to have an internal queue with qos)

On Monday, January 30, 2012 11:34:24 AM UTC-5, Richard Louapre wrote:

> Hi,
> 
> You can find [0] a first implementation of MongoDB plugin for ES.
> 
> This version has the following features:
> 
> - Monitoring MongoDB using oplog.rs collection.
> - Support for GridFS.
> 
> Please check the wiki [1] for more details.
> 
> [0] - [GitHub - richardwilly98/elasticsearch-river-mongodb: MongoDB River Plugin for ElasticSearch](https://github.com/richardwilly98/elasticsearch-river-mongodb)  
> [1] - [Home · richardwilly98/elasticsearch-river-mongodb Wiki · GitHub](https://github.com/richardwilly98/elasticsearch-river-mongodb/wiki)
> 
> Thanks,  
> Richard.

---

<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, 3:36am UTC](https://discuss.elastic.co/t/mongodb-river-plugin-for-elasticsearch/6540/10 "2017-07-06T03:36:44Z")

</div>


