Details
-
Bug
-
Resolution: Won't Fix
-
None
-
None
Description
This page doesn't include cluster authentication. The samples should start with the following:
START_CODE
from couchbase.cluster import Cluster
from couchbase.cluster import PasswordAuthenticator
cluster = Cluster('couchbase://localhost')
authenticator = PasswordAuthenticator('username', 'password')
cluster.authenticate(authenticator)
bucket = cluster.open_bucket('beer-sample')
END_CODE
Another problem is the changes we introduced to beer-sample bucket over time. There is only one design document there now, and it doesn't have "by_name" view any longer. So the code sample should use the only view that makes sense now, "brewery_beers", like below:
START_CODE
results = bucket.query('beer', 'brewery_beers')
for row in results:
print(row)
END_CODE
We should also use Python3 syntax, since Python2 is deprecated now.