Skip to content

Instantly share code, notes, and snippets.

@Eitol
Created March 17, 2017 17:15
Show Gist options
  • Save Eitol/9c6ef191c1d2d7f549cfcdb17f0773a2 to your computer and use it in GitHub Desktop.
Save Eitol/9c6ef191c1d2d7f549cfcdb17f0773a2 to your computer and use it in GitHub Desktop.
View names of all Views CouchDB in Python
_db = couchdb.Server("http://user:miclave_loca@192.168.1.250:5984/")['base_de_datos_loca']
def get_all_views(db: couchdb.Server) -> list:
views_raw = _db.view('_all_docs', startkey="_design/", endkey="_design0", include_docs=True)
return [view.id.split('/')[1] for view in views_raw.rows]
return views
if __name__ == '__main__':
print(get_all_views(_db))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment