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

SDK3: Support subdoc contentAs(idx, String.class)

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Major
    • 3.0.0-beta.1
    • None
    • None
    • None

    Description

      For txns, I need to retrieve a subdoc field as a String.  But I get this error on doing contentAs(idx, String.class):

      com.couchbase.client.core.deps.com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of `java.lang.String` out of START_OBJECT token
       at [Source: (byte[])"{"val":1}"; line: 1, column: 1] 

      I can contentAs(idx, JsonObject.class) fine, and then convert it into a String, but it would be nice to avoid this unnecessary step.

      This worked fine in SDK2.

      Attachments

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

        Activity

          People

            graham.pople Graham Pople
            graham.pople Graham Pople
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty