condition: Conditional expression ($cond)

Description Usage Arguments Value Examples

View source: R/aggregation_operators.R

Description

Evaluates a boolean expression to return one of the two specified return expressions.

Usage

1
condition(test, yes, no)

Arguments

test

Expression which returns a boolean value.

yes

Return this if the test returns true.

no

Return this if the test returns false.

Value

Return a list for using in mongopipe.

Examples

1
2
3
4
5
6
7
## Not run: 
cond <- condition(test = list("$isArray"="$chart"),
                  yes = list("$size"="$chart"),
                  no = 0)
jsonlite::toJSON(cond)

## End(Not run)

mongopipe documentation built on Jan. 20, 2021, 5:08 p.m.