# NOT RUN {
# initialize a CouchDB connection
(x <- Cushion$new())
row.names(mtcars) <- NULL
if ("bulktest" %in% db_list(x)) {
invisible(db_delete(x, dbname="bulktest"))
}
db_create(x, dbname="bulktest")
db_bulk_create(x, mtcars, dbname="bulktest")
# modify mtcars
mtcars$letter <- sample(letters, NROW(mtcars), replace = TRUE)
db_bulk_update(x, "bulktest", mtcars)
# change again
mtcars$num <- 89
db_bulk_update(x, "bulktest", mtcars)
# }
Run the code above in your browser using DataLab