condition {mongopipe} | R Documentation |
Evaluates a boolean expression to return one of the two specified return expressions.
condition(test, yes, no)
test |
Expression which returns a boolean value. |
yes |
Return this if the test returns true. |
no |
Return this if the test returns false. |
Return a list for using in mongopipe.
## Not run:
cond <- condition(test = list("$isArray"="$chart"),
yes = list("$size"="$chart"),
no = 0)
jsonlite::toJSON(cond)
## End(Not run)