@gen.coroutine
    def save_doc(self, doc):
        body = json_encode(doc)
        if '_id' in doc:
            # create new document, or update an existing document
            url = '{0}/{1}'.format(self.db_name, url_escape(doc['_id']))
            r = yield self._http_put(url, body)
        else:
            # create a new document
            url = self.db_name
            r = yield self._http_post(url, body)
        raise gen.Return(r)
Save/create a document to/in a given database. Response is a dict
dataset/ETHPy150Open nephics/tornado-couchdb/couch/couch.py/AsyncCouch.save_doc