assemble_query_filter: Assemble MongoDB query filter document

View source: R/rdb.gen.R

assemble_query_filterR Documentation

Assemble MongoDB query filter document

Description

Assemble MongoDB query filter document

Usage

assemble_query_filter(
  country_code = NULL,
  subnational_entity_name = NULL,
  municipality = NULL,
  level = NULL,
  type = NULL,
  date_min = NULL,
  date_max = NULL,
  is_draft = NULL,
  date_time_created_min = NULL,
  date_time_created_max = NULL,
  date_time_last_edited_min = NULL,
  date_time_last_edited_max = NULL,
  query_filter = NULL,
  base64_encode = TRUE
)

Arguments

country_code

The country_code(s) to be included. A character vector.

subnational_entity_name

The subnational_entity_name(s) to be included. A character vector.

municipality

The municipality(s) to be included. A character vector.

level

The level(s) to be included. A character vector.

type

The type(s) to be included. A character vector.

date_min

The minimum date to be included. A date or something coercible to.

date_max

The maximum date to be included. A date or something coercible to.

is_draft

TRUE means to include only referendum entries with draft status, FALSE to include only normal entries. Set to NULL in order to include both draft and normal entries.

date_time_created_min

The minimum date_time_created to be included. A datetime, or something coercible to (like "2006-01-02" or "2006-01-02T15:04:05Z"; assumed to be in UTC if no timezone is given).

date_time_created_max

The maximum date_time_created to be included. A datetime, or something coercible to (like "2006-01-02" or "2006-01-02T15:04:05Z"; assumed to be in UTC if no timezone is given).

date_time_last_edited_min

The minimum date_time_last_edited to be included. A datetime, or something coercible to (like "2006-01-02" or "2006-01-02T15:04:05Z"; assumed to be in UTC if no timezone is given).

date_time_last_edited_max

The maximum date_time_last_edited to be included. A datetime, or something coercible to (like "2006-01-02" or "2006-01-02T15:04:05Z"; assumed to be in UTC if no timezone is given).

query_filter

A valid MongoDB JSON query filter document which allows for maximum control over what data is included. This takes precedence over all of the above listed parameters, i.e. if query_filter is provided, the parameters country_code, subnational_entity_name, municipality, level, type, date_min, date_max, is_draft, date_time_created_min, date_time_created_max, date_time_last_edited_min and date_time_last_edited_max are ignored.

base64_encode

Whether or not to Base64-encode the resulting query filter document. Note that the query_filter argument provided to other functions of this package must be Base64-encoded.

Value

A character scalar containing a valid MongoDB JSON query filter document, Base64-encoded if base64_encode = TRUE.


zdaarau/c2d documentation built on Dec. 18, 2024, 1:24 p.m.