## Not run:
# (x <- Cushion$new())
#
# if ("sofadb" %in% db_list(x)) {
# invisible(db_delete(x, dbname="sofadb"))
# }
# db_create(x, dbname="sofadb")
#
# # create a document
# doc1 <- '{"name": "drink", "beer": "IPA", "score": 5}'
# doc_create(x, dbname="sofadb", doc1, docid="abeer")
#
# doc_get(x, dbname="sofadb", docid="abeer")
# revs <- db_revisions(x, dbname="sofadb", docid="abeer")
# doc_get(x, dbname="sofadb", docid="abeer", rev=revs[1])
# doc_get(x, dbname="sofadb", docid="abeer", rev=revs[2])
# doc_get(x, dbname="sofadb", docid="abeer", as='json')
# doc_get(x, dbname="sofadb", docid="abeer", revs=TRUE)
# doc_get(x, dbname="sofadb", docid="abeer", revs=TRUE, local_seq=TRUE)
# ## End(Not run)
Run the code above in your browser using DataLab