Created
March 17, 2017 17:15
-
-
Save Eitol/9c6ef191c1d2d7f549cfcdb17f0773a2 to your computer and use it in GitHub Desktop.
View names of all Views CouchDB in Python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_db = couchdb.Server("http://user:[email protected]: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