Details
-
Bug
-
Resolution: Fixed
-
Major
-
None
-
None
-
None
-
None
-
1
Description
Installed 3.0.0a4 and tried to execute the code from documentation here:
rom couchbase.cluster import Cluster
from couchbase_core.cluster import PasswordAuthenticator
cluster = Cluster('couchbase://10.112.192.101')
authenticator = PasswordAuthenticator('Administrator', 'password')
cluster.authenticate(authenticator)
cb = cluster.bucket('default')
cb_coll=cb.default_collection()
cb_coll.upsert('u:king_arthur',
)
- OperationResult<RC=0x0, Key=u'u:king_arthur', CAS=0xb1da029b0000>
print(cb_coll.get('u:king_arthur').contentAs[str])
- {u'interests': [u'Holy Grail', u'African Swallows'], u'name': u'Arthur', u'email': u'kingarthur@couchbase.com'}
-
- The CREATE PRIMARY INDEX step is only needed the first time you run this script
cluster.query('CREATE PRIMARY INDEX ON default')
- The CREATE PRIMARY INDEX step is only needed the first time you run this script
from couchbase_core.n1ql import N1QLQuery
row_iter = cluster.query(N1QLQuery('SELECT name FROM default WHERE ' + \
'$1 IN interests', 'African Swallows'))
for row in row_iter: print(row)
Throws the following error:
Traceback (most recent call last):
File "test-python3.py", line 3, in <module>
cluster = Cluster('couchbase://10.112.192.101')
File "/Users/a.senthilnathan/.pyenv/versions/3.6.8/lib/python3.6/site-packages/couchbase/cluster.py", line 100, in _init_
raise ArgumentError("Authenticator is mandatory")
I am using python 3.6.8
Attachments
Issue Links
- relates to
-
PYCBC-621 Update Cluster constructor docs to indicate mandatory authenticator
- Resolved