db_alldocs: List all docs in a given database.

Description Usage Arguments Value Examples

View source: R/db_alldocs.R

Description

List all docs in a given database.

Usage

1
2
db_alldocs(cushion, dbname, descending = NULL, startkey = NULL,
  endkey = NULL, limit = NULL, include_docs = FALSE, as = "list", ...)

Arguments

cushion

A Cushion object. Required.

dbname

Database name. (charcter)

descending

Return in descending order? (logical)

startkey

Document ID to start at. (character)

endkey

Document ID to end at. (character)

limit

Number document IDs to return. (numeric)

include_docs

(logical) If TRUE, returns docs themselves, in addition to IDs. Default: FALSE

as

(character) One of list (default) or json

...

Curl args passed on to one of the HTTP verbs (e.g,. GET, POST, PUT, etc.)

Value

JSON as a character string or a list (determined by the as parameter)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## Not run: 
(x <- Cushion$new())

db_create(x, dbname='leothelion')
bulk_create(x, mtcars, dbname="leothelion")

db_alldocs(x, dbname="leothelion")
db_alldocs(x, dbname="leothelion", as='json')
db_alldocs(x, dbname="leothelion", limit=2)
db_alldocs(x, dbname="leothelion", limit=2, include_docs=TRUE)

# curl options
library('httr')
res <- db_alldocs(x, dbname="leothelion", config=verbose())

## End(Not run)

sofa documentation built on May 29, 2017, 3:55 p.m.