Mongodb with Elasticsearch: nested document

Hi all,
Now,I'm working with nested document in ES. by using mongo river for
insert data.
So, I just wander what is the best way to handle insert nested document.
For example:
{
"name": "Multi G. Enre", "books": [ { "name": "Guns and lasers", "genre":
"scifi", "publisher": "orbit" }, { "name": "Dead in the night", "genre":
"thriller", "publisher": "penguin" } ] }
this one is my document and books is nested document. So, when I want to
add/insert book into this document . which mongo operation is the best
solution for this to match with ES that in ES we can insert only nested
document and link it to parent document.

So on, I can think only few ways.

  1. just use $push operator to add new books(nested document).
  2. use $set operator to reset every thing under books.

but I do not know that how mongo-river handle for this. I know that
mongo-river support with nested document but not really sure that which way
is the best for this scenario.

Thanks,

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/ee94e83d-7cdb-4db8-a619-7729524fa00d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.