Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-27911

Implement range notation for json path

Details

    Description

      Implement range with the to keyword. This gives subsets of JSON arrays in output. Example, $[1 to 4] includes elements starting from 1st index to 4th index in the array.

      Attachments

        Issue Links

          Activity

            rucha174 Rucha Deodhar added a comment - - edited Patch: https://github.com/MariaDB/server/commit/82d7e8199a14c3e522ebb152b4ae9a184e929895

            ok to push.

            holyfoot Alexey Botchkov added a comment - ok to push.
            rucha174 Rucha Deodhar added a comment - - edited

            pushed to preview branch: preview-10.9-MDEV-27911

            rucha174 Rucha Deodhar added a comment - - edited pushed to preview branch: preview-10.9-MDEV-27911

            Testing done. Please, rucha174, don't forget to add information about behavior for range like [-2 to 1] or [-1 to 1] (see an example) in documentation.

            SET @json= '[ 11, 22 , 33]';
            SELECT JSON_EXTRACT(@json, '$[-2 to 1]');
            SELECT JSON_EXTRACT(@json, '$[-1 to 1]');
            

            lstartseva Lena Startseva added a comment - Testing done. Please, rucha174 , don't forget to add information about behavior for range like [-2 to 1] or [-1 to 1] (see an example) in documentation. SET @json= '[ 11, 22 , 33]'; SELECT JSON_EXTRACT(@json, '$[-2 to 1]'); SELECT JSON_EXTRACT(@json, '$[-1 to 1]');
            rucha174 Rucha Deodhar added a comment -

            lstartseva , thank you ! Yes, I have added it in documentation. Added as 'note' under array element selector

            rucha174 Rucha Deodhar added a comment - lstartseva , thank you ! Yes, I have added it in documentation. Added as 'note' under array element selector

            People

              rucha174 Rucha Deodhar
              rucha174 Rucha Deodhar
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.