Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-43890

N1QL: Provide OBJECT_PAIRS_NESTED to get arbitrary field names

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Major
    • 7.1.0
    • 6.6.2, 6.5.2, Cheshire-Cat
    • query
    • 1

    Description

      The idea behind this is to provide a function which only provides fields that match a certain name at any level within a document.

      Pasting the slack discussion I had with Marco about this:

      Tim Bradgate 17:52
      So maybe this is a horrible question, but how plausible would it be to allow N1QL to do something like select *.b from a where c… , and return the list of paths *.b which match the pattern? So if you didn’t know the nesting level of your data for example

      Marco Greco 17:54
      yawser
      17:54
      let me get my head round that
      17:54
      you basically want to find any field in your document that has a b subdocument

      Tim Bradgate 17:56
      I’m not saying I want to :wink:
      But yes, was thinking about this the other night, could have two ways of doing it, so a..c which matches the path at a single level, and then a.*.c (ant style) to match any depth path from a to c

      Marco Greco 17:56
      from a planning and projection point of view that would be a nightmare

      Tim Bradgate 17:57
      This basically came from, an API is giving me some data about something, but doesn’t tell you in what structure that data appears in. So I know all the field names, but not their paths in the resulting document

      Marco Greco 17:57
      you probably want some field search function

       

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              mihir.kamdar Mihir Kamdar (Inactive)
              tim.bradgate Tim Bradgate (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty