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

Update the sdk example

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Critical
    • Mad Hatter
    • Mad Hatter
    • sdk
    • None
    • 1

    Description

      Hi 

      I am seeing the hello world example is not update as per couchbase-3.0.0a4 . Correct example should be as 

      from couchbase.cluster import Cluster
      from couchbase_core.cluster import PasswordAuthenticator
      from couchbase.durability import Durability
      from couchbase.cluster import ClusterOptions
      try:
          authenticator = PasswordAuthenticator('default', 'password')
          cluster = Cluster('couchbase://10.143.190.101',ClusterOptions(authenticator))
          cb = cluster.bucket('default')
          cb_coll=cb.default_collection()
          cb_coll.upsert('king_arthur1', {'name': 'Arthur', 'email': 'kingarthur@couchbase.com', 'interests': ['Holy Grail', 'African Swallows']})
      except Exception as e:
          print (e) 

      link https://docs.couchbase.com/python-sdk/3.0/hello-world/start-using-sdk.html

      Attachments

        Issue Links

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

          Activity

            People

              amarantha.kulkarni Amarantha Kulkarni (Inactive)
              vikas.chaudhary Vikas Chaudhary
              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