Uploaded image for project: 'Couchbase Python Client Library'
  1. Couchbase Python Client Library
  2. PYCBC-891

Review GetResult and LookupInResult design around edge cases

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • .backlog3.x
    • 3.0.0-rc
    • library
    • None
    • 1
    • SDK22: Docs,Publish,Pipeline, SDK24: Txnλ+Func,TxnFormer,CoC

    Description

      When you do a collection.get(<key>, GetOptions(with_expiry=True)), you expect that there will be a property on the GetResult that is returned with the expiry, and when you do result.content_as[dict] you will see the entire document (and nothing else). If you instead ask for a projection collection.get(<key>, GetOption(project=["a", "b"], with_expiry=True)), you'd expect the expiry like before, and the content_as to give you just the projection.

      In fact, the former (thanks to a recent hack) is what happens. But the latter case gives you the projection, plus the expiry field from the xattrs ("$document.exptime: xxx")

      In fact this is a bit tricky under the covers. The GetResult realized it was created from a SubdocResult, and needs to do a bit of work to get what you'd expect for a GetResult. Perhaps we can rethink what I did? Doing things close to GA, I did the most expedient thing I could do, and probably with a bit of thought, maybe a somewhat more clever ContentProxy, we can clean this up, and eliminate the xattr field from the result of a content_as.

      Also... should we be more clever about how we return results to show which are xattrs? Worth pondering.

      Attachments

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

        Activity

          People

            jared.casey Jared Casey
            david.kelly David Kelly (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty