Skip to contents

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

Examples

if (FALSE) {
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)

}