Script Filters referencing a field with special characters


(posejavier) #1

Hi all,
I have a Script Filters defined in the couchdb river.
In this script I need to refer to a field of the documents which has special characters on it, e.g. '-'
So the field would be, for example: 'number-of-houses'

How can I refer to this field from the Script Filter ??

In a normal javascript in a view I would use doc['number-of-houses'], but in the Script Filters I don't know...
I tried:

ctx.doc['number-of-houses']
ctx.doc.'number-of-houses'
ctx[doc]['number-of-houses']
...

...but none of these options works.


(system) #2