compound_filter: Compound database filter

Description Usage Arguments Details Value Examples

View source: R/filters.R

Description

The compound_filter function combines two filters into a compound one. These filters can either be compound filters themselves, or single-level filters as described in property_filter. This filter is only meant for use within the query_database function.

Usage

1
compound_filter(x, y, type = "and")

Arguments

x

A property filter; either compound or single-level.

y

A property filter; either compound or single-level.

type

A string indicating what type of compound filter. Must be either "and" or "or".

Details

Compound filters can be nested up to 2 levels deep. Currently there is no checking for this, so it's on the user to adhere to it.

Value

A structured compound filter.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
compound_filter(
  x = property_filter(
    property = "Landmark",
    type = "text",
    body = contains ~ Bridge
  ),
  y = property_filter(
    property = "Bodies of Water",
    type = "checkbox",
    body = equals ~ TRUE
  ),
  type = "and"
)

dmolitor/notionr documentation built on Dec. 20, 2021, 12:11 a.m.