Modifying documents in CouchDB river's script

It's currently possible to modify the document in the CouchDB river's
script. From documentation:

{
"type" : "couchdb",
"couchdb" : {
"script" : "ctx.doc.field1 = 'value1'"
}
}

This works fine as long as the assigned value is a string. Trying to assign
an array:

{
"type" : "couchdb",
"couchdb" : {
"script" : "ctx.doc.field1 = ['value1', 'value2']"
}
}

In this case, field1 is assigned an obscure string representation of the
array. I didn't try objects, but I'm assuming that all values are coerced to
strings.

Is there any chance this could be fixed? If not, this should at least be
documented.

This is a bug of not converting the resulting computation from the native
javascript objects. Opened an issue:
CouchDB River: Custom script does not convert the modified doc properly to be indexed · Issue #1225 · elastic/elasticsearch · GitHub.

On Wed, Aug 10, 2011 at 1:17 PM, Petri Lehtinen petri@digip.org wrote:

It's currently possible to modify the document in the CouchDB river's
script. From documentation:

{
"type" : "couchdb",
"couchdb" : {
"script" : "ctx.doc.field1 = 'value1'"
}
}

This works fine as long as the assigned value is a string. Trying to assign
an array:

{
"type" : "couchdb",
"couchdb" : {
"script" : "ctx.doc.field1 = ['value1', 'value2']"
}
}

In this case, field1 is assigned an obscure string representation of the
array. I didn't try objects, but I'm assuming that all values are coerced to
strings.

Is there any chance this could be fixed? If not, this should at least be
documented.

Thanks for a fast fix.