Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Here is what the custom_fields json jsonb data array looks like:



The code to do that is:

...

Because "departments" is an array, you still have to extract it with a cross join statement, as in the previous example.  In the code below, I am using the shorthand method to extract the various elements:

SELECT
users.idASuser_id,
(users.jsonb #>> '{active}')::BOOLEANASpatron_status,

...