Working with JSONB fields


I am having problems querying JSONB fields from a postgres database. They are set as field containing JSON in metabase.

I can’t seem to build queries that filter correctly on the JSONB values (I get no results or an exception error), and have had no success trying to cast into seperate columns.

Has anyone successfully worked with JSONB data in metabase?

Thanks in advance!

I don’t think JSONB is currently support (go and vote by clicking the :+1: on the first post)


You can work with JSONB with metabase succesfully but it needs to make an architecture to support this. The simplest example is that :

  1. JSONB tables
  2. Views that made a transformation from jsonb to table columns so that when you select the view you see just a table (optional layer that helps to have a ‘table’ like reference.
  3. Stored Procedures that get your filters that will be given from metabase and return a table. At least this is supported into PostgreSQL.
  4. Into metabase, you create custom queries that refer to these Stored Procedures that return tables.
    Metabase can’t distinguish if the select statement refers to an actual table or a stored procedure that returns a table.
    Job done. Have a good luck and a good design.