Description Usage Arguments Details Value Author(s) See Also Examples
This is done via the _bulk_docs API provided by an already existing database.
1 | cdbAddDocS(cdb)
|
cdb |
|
The _bulk_docs endpoint requires that cdb$dataList
resolves
to an json array. This is reached with e.g.
cdb$dataList <- list(list(...),list(...),...)
.
Furthermore, _bulk_docs requires the documents to be wrapped in a key
named docs:[...]
; this is done by cdbAddDocS()
if
cdb$dataList
is a list of lists. The user dont need to care.
At the moment the resulting _rev
and _id
will be not
written back to the cdb$dataList
. This means that a second
call of cdbAddDocS()
generates new Documents.
cdb |
The couchdb response is stored in |
parisni, wactbprot
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ## Not run:
ccc <- cdbIni()
# I assume a database at localhost:5984 already exists
ccc$DBName <- "r4couchdb_db"
docs <- list()
for(i in 1:10){
docs[[i]] <- list(normalDistRand = rnorm(20))
}
# docs is noe a list of 10 lists
ccc$dataList <- docs
# generating 10 database documents
cccAddDocS(ccc)$res
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.