I'm trying to update a document by adding/updating an array of objects, using client.execute { update ... }
, but I'm having issues trying to pass in key value pairs in Elastic4s. I can't find any documentation on ctx._source
, except for this which says nothing.
val store_reservation_response_future = client.execute {
update(ota_id) in "rsconfig/ota" script "ctx._source.developers =
[key]" params(Map("key" -> "value"))
}
The preceding code puts the following in the db:
"developers": [ "value" ]
I tried:
params(Map("key" -> (Map("key1" -> "value"))))
But I get the following error:
background log: error: Caused by: java.io.IOException: Can't write type [class scala.collection.immutable.Map$Map1]
How do I add a key value pair?
I found a java solution, but it did not help me.
If there is any documentation someone can point me to, I would greatly appreciate the help.