Skip to main content

jsonb_exists_any

Function jsonb_exists_any 

Source
pub fn jsonb_exists_any<'a, E>(
    expr: E,
    keys: &[&'a str],
) -> SQLExpr<'a, PostgresValue<'a>, Boolean, NonNull, Scalar>
where E: Expr<'a, PostgresValue<'a>>,
Expand description

PostgreSQL ?| operator for JSONB - do any of the keys exist?

ยงExample

let data = SQL::<PostgresValue>::raw("data");
let cond = jsonb_exists_any(data, &["name", "email"]);
assert!(cond.to_sql().sql().contains("?|"));