idf_json_query: Query _docs_ from an iDAI.field Database Based on a...

View source: R/idf_query.R

idf_json_queryR Documentation

Query docs from an iDAI.field Database Based on a JSON-Query

Description

This function can be used to gather docs from an iDAI.field / Field Desktop Database using a JSON-Query as detailed by the CouchDB-API Docs.

Usage

idf_json_query(connection, query, projectname = NULL)

Arguments

connection

A connection object as returned by connect_idaifield()

query

A valid JSON-query as detailed in the relevant section of the CouchDB-API documentation.

projectname

(deprecated) The name of the project to be queried (overrides the one listed in the connection-object).

Value

An idaifield_docs list

See Also

  • Learn how to build the selector-query with the CouchDB-API.

  • Alternative functions: idf_query(), idf_index_query()

Examples

## Not run: 
conn <- connect_idaifield(pwd = "hallo", project = "rtest")

# Get all documents that contain "Anna Allgemeinperson" as processor
query <- '{ "selector": { "resource.processor": ["Anna Allgemeinperson"] } }'
result <- idf_json_query(conn, query = query)


# Get all documents where hasRestoration is TRUE
query <- '{ "selector": { "resource.hasRestoration": true } }'
result <- idf_json_query(conn, query = query)

# Get all documents where hasRestoration is TRUE
# but only the fields *identifier* and *hasRestoration*
query <- '{ "selector": { "resource.hasRestoration": true },
"fields": [ "resource.identifier", "resource.hasRestoration" ] }'
result <- idf_json_query(conn, query = query)


## End(Not run)

lsteinmann/idaifieldR documentation built on April 3, 2025, 2:06 p.m.