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

setKey() Doesn't Maintain String Value

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Critical
    • None
    • 1.1dp
    • Core
    • Security Level: Public
    • None
    • Impediment

    Description

      I have a view with string keys which happen to also be valid integers. In this case routing numbers that can have leading zeros. When I perform a get in using the Java API, the request forwarded to the database assumes I actually meant to send an integer type and the quotes are not sent to as apart of the database query, along with the leading zero now trimmed. If I try to force quotes into the key string, I get extra keys sent with the query.

      I'm assuming the API is guessing the query type based on my input but wouldn't it be better to overload the method for specific types, specifically the primitive types?

      Example:

      query.setKey("011601087"); results in ?stale=false&key=011601087 but I need ?stale=false&key="011601087"

      If I try:
      query.setKey("\"011601087\""); results in ?stale=false&key=011601087 but I need ?stale=false&key=""011601087""

      Attachments

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

        Activity

          People

            rags Raghavan Srinivas (Inactive)
            pgallagher Patrick Gallagher
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty