doc_head: Get header info for a document.

Description Usage Arguments Value Examples

Description

Get header info for a document.

Usage

1
doc_head(cushion, dbname, docid, as = "list", ...)

Arguments

cushion

A Cushion object. Required.

dbname

(character) Database name. Required.

docid

(character) Document ID. Required.

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
17
18
## Not run: 
(x <- Cushion$new())

# create a database
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")

# run doc_head
doc_head(x, dbname="sofadb", docid="abeer")
doc_head(x, dbname="sofadb", docid="abeer", as='json')

## End(Not run)


Search within the sofa package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.