Uploaded image for project: 'Couchbase Documentation'
  1. Couchbase Documentation
  2. DOC-6303

Node SDK 3.0 Named Parameter Query Snippet incorrect

    XMLWordPrintable

Details

    • DOC-2020-S16-Aug23
    • 1

    Description

      The linked docs section contains the following code snippet:

      var parameters = new QueryParameters()
          .Add('type', 'User');
      var options = new QueryOptions();
       
      var result = await cluster.query(
          'SELECT x.* FROM `default` WHERE x.Type=$type',
          {'type': 'User'});
      

      Neither QueryParameters() or QueryOptions are used in the query call, nor are they exported at all in the Node 3.0 SDK. Furthermore, the example for specifying the named parameters is the incorrect way to pass these parameters to the SDK.

       

      The linked JSCBC explains a bug that means correctly specified named parameters also don't work as intended. This needs to be fixed to determine what the correct code for this example should be.

      Attachments

        Issue Links

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

          Activity

            People

              richard.smedley Richard Smedley
              daniel.roberts Daniel Roberts (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty