Couchdb_changes gives Invalid FieldReference error when parsing couchdb which hosts couchapp

That is a known issue. The code uses event.set and there is no way to stop event.set parsing field references.

If the set of offending keys is fixed you could mutate+gsub them. If it is dynamic then you would have to use a ruby filter (reusing code from the json filter) and iterate over the resulting keys to mutate them if needed before doing the event.set call.