Uploaded image for project: 'FOLIO'
  1. FOLIO
  2. FOLIO-921 Handling array structures in PostgreSQL JSON objects
  3. FOLIO-922

Searching in repeated fields (arrays) in PostgreSQL JSON records.

    XMLWordPrintable

Details

    • Core: Platform

    Description

      The issue is how to perform searches for records that contain certain values in the elements of an array.

      They can be search along the lines of object identities for sure, like asking for records that have an element that is an object with certain properties containing certain values:

      For example find within array objects with a property "value": "xyz"

      select * from diku_mod_inventory_storage.instance where jsonb->'identifiers' @> '[

      {"value": "9780552142352"}

      ]';

      Or with two properties - in this example one of the properties is a reference to the identifier type "ISBN":

      select * from diku_mod_inventory_storage.instance where jsonb->'identifiers' @> '[

      {"value": "9780552142352", "typeId": "8261054f-be78-422d-bd51-4ed9f33c3422"}

      ]';

      But the question is, can we also somehow search with truncation? That would obviously be needed for searching for authors in the 'creators' array.

      And how will it perform?

      TestRail: Results

        Attachments

          Issue Links

            Activity

              People

                Unassigned Unassigned
                nielserik Niels Erik Gilvad Nielsen
                Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  TestRail: Runs

                    TestRail: Cases