You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// The `cluster.bucket` retrieves the bucket you set up for the student cluster.
23
+
Bucketbucket = cluster.bucket("student-bucket");
24
+
25
+
// Most of the Couchbase APIs are non-blocking.
26
+
// When you call one of them, your application carries on and continues to perform other actions while the function you called executes.
27
+
// When the function has finished executing, it sends a notification to the caller and the output of the call is processed.
28
+
// While this usually works, in this code sample the application carries on without waiting for the bucket retrieval to complete after you make the call to `cluster.bucket`.
29
+
// This means that you now have to try to retrieve the scope from a bucket object that has not been fully initialized yet.
30
+
// To fix this, you can use the `waitUntilReady` call.
31
+
// This call forces the application to wait until the bucket object is ready.
32
+
bucket.waitUntilReady(Duration.ofSeconds(10));
33
+
34
+
// The `bucket.scope` retrieves the `art-school-scope` from the bucket.
35
+
Scopescope = bucket.scope("art-school-scope");
36
+
37
+
// The `scope.collection` retrieves the student collection from the scope.
0 commit comments