extracting couchdb documents