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

UI for Java script N1QL UDF support

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Major
    • 7.1.0
    • 7.1.0
    • UI
    • 1

    Description

      For N1QL JS UDFS we typically have to do the following:

      1. Register a library, having all relevant functions, with the evaluator. This can be done by POSTing the library code to the “evaluator/v1/libraries” REST endpoint.

      2. A N1QL function now needs to be registered against the function you want to execute.

       The 1st step is done via curl and 2nd step can be done via QWB.

      If we could find a way to do step1 in UI as well, that would be perfect.

      For e.g.

      1.

      curl -v -X POST http://localhost:8093/evaluator/v1/libraries/udf2 -u Administrator:password  -H 'content-type: application/json' -d 'function queryselect(){var a = 10;var query = INSERT INTO b values(UUID(),

      {"x": 99, "y":88}

      ) returning meta(), *;var acc = [];for (const row of query)

      {acc.push(row);}

      return acc;}'

      2.CREATE FUNCTION qs4() LANGUAGE javascript AS "queryselect" AT "udf2"      

      3. EXECUTE FUNCTION qs4()

      Step1 happens via curl on command line
      Step 2 and 3 can be done via cbq or QWB

       

      Relevant docs:

      https://docs.google.com/document/d/1lEJe-PTqHQfjsZ5Xg-qDsmms35WtThaHYMyfHUAKbfQ/edit
      https://docs.google.com/document/d/172SkX4GwbmOb2DBeQRCZSN6YdBcKLjNqj5fsu0_TYYg/edit

       

      Attachments

        Issue Links

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

          Activity

            People

              pierre.regazzoni Pierre Regazzoni
              kamini.jagtiani Kamini Jagtiani
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty