Skip to content

Instantly share code, notes, and snippets.

@shahidhk
Last active April 26, 2022 03:29
Show Gist options
  • Save shahidhk/5d02ff8ed039e68179bd0d9600495ddc to your computer and use it in GitHub Desktop.
Save shahidhk/5d02ff8ed039e68179bd0d9600495ddc to your computer and use it in GitHub Desktop.
Operator Postgres equivalent Description
_contains @> Does the column value contains these key-value pairs at top-level?
_contained_in <@ Is the column value contained in this JSON object at top-level?
_has_key ? Does the string exist as a top-level key within the JSON value?
_has_keys_any ?| Do any of these array strings exist as top-level keys?
_has_keys_all ?& Do all of these array strings exist as top-level keys?
@jibrel
Copy link

jibrel commented Apr 26, 2022

can Hasura graphql do aggregates inside jsonb objects

like this SQL query
SELECT COUNT(*), planets#>>'{name,0,given,0}' FROM cosmos GROUP BY planets#>>'{name,0,given,0}' ORDER BY COUNT(*) DESC;

how would it translate in graphql

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment