I'm trying to construct a query on an array using massivejs, but it keeps telling me the operator is unsupported.
This query works:
SELECT * FROM my_table WHERE data->'items' @> '[{"foo": "bar"}]';
where data
is a jsonb field and items
is an array of objects. My massivejs query is:
{ 'data #>> {items} @>': '[{ \"foo\": \"bar\" }]' }
but massive tells me the @>
operator doesn't exist.
I realize I can execute raw SQL, but I'm building up a query with paging, sorting, and other query conditions, so I'd rather not rebuild all that if I can avoid it.
Is there a mistake in my query? Is this something massivejs even supports?