Uploaded image for project: 'Couchbase Java Client'
  1. Couchbase Java Client
  2. JCBC-978

Index: withNode() / withDeferAndNode() should accept a String or a List of Strings and format options as JSON Array

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.2.8, 2.3.0
    • 2.3.1
    • N1QL
    • None

    Description

      Currently, the withNode() and withDeferAndNode() methods only accept a single String for the node name, and then with() formats this as a single JSON item in options.

      The correct syntax for CREATE INDEX is actually an array of nodes (WITH {"nodes":["nodeA:8091"]}, see http://developer.couchbase.com/documentation/server/current/n1ql/n1ql-language-reference/createindex.html).

      1. withNode() and withDeferAndNode() need to be overloaded to accept a List of Strings as well as a single String
      2. with() needs to format options using a JsonArray for nodes rather than just a String, regardless of what is passed in.

      The tests at https://github.com/couchbase/couchbase-java-client/blob/master/src/test/java/com/couchbase/client/java/query/dsl/IndexDslTest.java#L98 will also need updating.

      Attachments

        Issue Links

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

          Activity

            I'll had different signatures for the multi-nodes use case (as I cannot change the public API):

            withNodes() and withDeferAndNodes() (plural) will both accept a vararg and a collection of strings. All the methods will be exporting a JSON array though.

            simonbasle Simon Baslé (Inactive) added a comment - I'll had different signatures for the multi-nodes use case (as I cannot change the public API): withNodes() and withDeferAndNodes() (plural) will both accept a vararg and a collection of strings. All the methods will be exporting a JSON array though.

            Perfect, thank you!

            malarky Chris Malarky added a comment - Perfect, thank you!

            People

              simonbasle Simon Baslé (Inactive)
              malarky Chris Malarky
              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