## Not run:
# # Create a CouchDB connection client
# (x <- Cushion$new())
#
# ## metadata
# x$host
# x$path
# x$port
# x$type
#
# ## ping the CouchDB server
# x$ping()
#
# ## CouchDB server statistics
# # stats(x)
#
# # create database
# db_create(x, "stuff")
#
# # add documents to a database
# db_create(x, "sofadb")
# doc1 <- '{"name": "drink", "beer": "IPA", "score": 5}'
# doc_create(x, dbname="sofadb", docid="abeer", doc1)
#
# # bulk create
# db_create(x, "mymtcars")
# bulk_create(x, dbname="mymtcars", doc = mtcars)
# db_list(x)
#
# ## database info
# db_info(x, "bulktest")
#
# ## list dbs
# db_list(x)
#
# ## all docs
# alldocs(x, "bulktest", limit = 3)
#
# ## changes
# changes(x, "bulktest")
#
# # With auth
# x <- Cushion$new(user = 'sckott', pwd = 'sckott')
#
# # Using Cloudant
# z <- Cushion$new(host = "ropensci.cloudant.com", transport = 'https', port = NULL,
# user = 'ropensci', pwd = Sys.getenv('CLOUDANT_PWD'))
# z
# db_list(z)
# db_create(z, "stuff2")
# db_info(z, "stuff2")
# alldocs(z, "foobar")
# ## End(Not run)
Run the code above in your browser using DataLab