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

Feedback on Sub-Document Operations | Couchbase Docs

    XMLWordPrintable

Details

    Description

      Replace is not working in sub-document operations:

      Code:
      import couchbase.subdocument as SD
      db._adapter.collection.mutate_in('airline1', (SD.replace('name', 'Arslan Airways')))
      print(db._adapter.getDocument(docids =['airline1']))

      error: Traceback (most recent call last):
      File "/Users/user/Documents/pydal/test.py", line 90, in <module>
      db._adapter.collection.mutate_in('airline1', (SD.replace('extra', 'field')))
      File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/couchbase/logic/wrappers.py", line 102, in wrapped_fn
      raise excptn from None
      couchbase.exceptions.InternalSDKException: InternalSDKException(<message='SubDocOp' object is not subscriptable>)

      Browser environment: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.5.2 Safari/605.1.15

      Reporter: Eelaaf Zahid
      E-mail: eelaaf.zahid@ibm.com

      Attachments

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

        Activity

          People

            richard.smedley Richard Smedley
            docsite-collector Docs Site Collector
            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