cdbAddDoc {R4CouchDB} | R Documentation |
This function adds a new document to an already existing database
cdbAddDoc(cdb)
cdb |
The list |
This function is called addDoc (which means add a new document). Therefore
the cdb$id
is requested using cdbGetUuid()
for every document
to add if no cdb$id
is provided. If a cdb$id
is provided the
function fails when a document with the given id already exists. In this
case one should use cdbUpdateDoc()
. Since version v0.6 the function
writes the _rev
and _id
key to the top level of
cdb$dataList
.
cdb |
The couchdb response is stored in |
wactbprot
cdbGetDoc()
## Not run:
ccc <- cdbIni()
# I assume a database at localhost:5984 already exists
ccc$DBName <- "r4couchdb_db"
ccc$dataList <- list(normalDistRand = rnorm(20))
ccc <- cdbAddDoc(ccc)
## End(Not run)