couchdb groovy functions