Working on CouchDB map function