Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PYCBC-1082 named scopes #159

Merged
merged 8 commits into from Jul 20, 2021
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions modules/ROOT/nav.adoc
Expand Up @@ -19,7 +19,7 @@
* xref:howtos:concurrent-async-apis.adoc[Async APIs]
* xref:howtos:concurrent-document-mutations.adoc[Concurrent Document Mutations]
//* xref:howtos:durability.adoc[Durability]
* xref:howtos:working-with-collections.adoc[Working with Collections DP]
* xref:howtos:working-with-collections.adoc[Working with Collections]

.Managing Couchbase
//* User Management
Expand Down Expand Up @@ -65,7 +65,7 @@
.Reference
* https://docs.couchbase.com/sdk-api/couchbase-python-client[Python API Reference]
* xref:ref:client-settings.adoc[Client Settings]
* xref:ref:error-codes.adoc[Error Messages]
* xref:ref:error-codes.adoc[Error Messages]
* xref:ref:glossary.adoc[Glossary]
* xref:ref:travel-app-data-model.adoc[Travel Sample Data Model]

Expand Down
4 changes: 3 additions & 1 deletion modules/concept-docs/pages/analytics-for-sdk-users.adoc
Expand Up @@ -4,6 +4,8 @@
:page-topic-type: concept
:page-aliases: analytics,

include::project-docs:partial$attributes.adoc[]

[abstract]
{description}

Expand All @@ -21,5 +23,5 @@ For complex and long-running queries, involving large ad hoc join, set, aggregat

== Additional Resources

* Start with our xref:6.5@server:analytics:primer-beer.adoc[introductory primer].
* Start with our xref:{version-server}@server:analytics:primer-beer.adoc[introductory primer].
* Read the practical introduction xref:howtos:analytics-using-sdk.adoc[using analytics from the SDK].
6 changes: 4 additions & 2 deletions modules/concept-docs/pages/buckets-and-clusters.adoc
Expand Up @@ -4,10 +4,12 @@
:page-topic-type: concept
:page-aliases: managing-clusters

include::project-docs:partial$attributes.adoc[]

[abstract]
{description}

include::7.0@sdk:shared:partial$clusters-buckets.adoc[tag=management]
include::{version-server}@sdk:shared:partial$clusters-buckets.adoc[tag=management]

////
Management operations in the Python SDK may be performed through several interfaces depending on the object:
Expand All @@ -24,7 +26,7 @@ manager.createBucket(bucketSettings);
----

// The `BucketSettings` can be created via a builder, [.api]`DefaultBucketSettings.builder()`.
This class is also used to expose information about an existing bucket (`manager.getBucket(string)`) or to update an existing bucket (`manager.updateBucket(bucketSettings)`).
This class is also used to expose information about an existing bucket (`manager.getBucket(string)`) or to update an existing bucket (`manager.updateBucket(bucketSettings)`).

The default Collection & Default Scope will be used automatically.
////
@@ -1 +1,3 @@
include::7.0@sdk:pages:partial$certificates.adoc[]
include::project-docs:partial$attributes.adoc[]

include::{version-server}@sdk:pages:partial$certificates.adoc[]
17 changes: 10 additions & 7 deletions modules/concept-docs/pages/collections.adoc
@@ -1,17 +1,18 @@
= Collections & Scope
:description: pass:q[Available as a _Developer Preview_ in Couchbase Server 6.5.]
:description: Fully supported in Couchbase Server 7.0.
:page-topic-type: concept
:nav-title: Collections
:page-status: Developer Preview

include::project-docs:partial$attributes.adoc[]

[abstract]
{description}

The Developer Preview of the upcoming Collections feature in Couchbase Server is fully implemented in the 3.x API versions of the Couchbase SDKs.
Information on the Developer Preview (DP) of _Collections_ can be found in the xref:6.5@server:developer-preview:collections/collections-overview.adoc[server docs].
The Collections feature in Couchbase Server is fully implemented in the 3.2 API version of the Couchbase SDK.

== Using Collections & Scope DP
Information on _Collections_ can be found in the xref:{version-server}@server:learn:data:scopes-and-collections.adoc[server docs].

== Using Collections & Scope

Access a non-default collection, in the default scope, with:

Expand All @@ -26,5 +27,7 @@ And for a non-default scope:
bucket.scope("marlowe_agency").collection("flights")
----

* Please see the xref:6.5@server:developer-preview:collections/collections-overview.adoc[Collections Overview documents] in the Server docs.
// * To see Collections in action, take a look at our xref:howtos:working-with-collections.adoc[Collections-enabled Travel Sample page].
== Further Reading

* Please see the xref:{version-server}@server:developer-preview:collections/collections-overview.adoc[Collections Overview documents] in the Server docs.
* To see Collections in action, take a look at our xref:hello-world:sample-application.adoc[Collections-enabled Travel Sample page].
3 changes: 1 addition & 2 deletions modules/concept-docs/pages/compression.adoc
Expand Up @@ -3,7 +3,6 @@
:page-topic-type: concept
:page-edition: Enterprise Edition
:page-aliases:../../ROOT/pages/compression-intro.adoc
include::partial$attributes.adoc[]

[abstract]
{description}
Expand All @@ -24,7 +23,7 @@ Compression is only available in the Enterprise Edition of Couchbase Data Platfo

[TIP]
====
This size limit is enforced by Couchbase Server (6.5 and earlier); in practice it will affect very few users, as most JSON documents are considerably smaller.
This size limit is enforced by Couchbase Server; in practice it will affect very few users, as most JSON documents are considerably smaller.
A compressed doument of just under 20MB, which is greater than 20,971,520 bytes (20 MiB) when uncompressed, will be rejected by the server as follows:

* Couchbase Server decompresses the document to check that it is valid JSON, and is correctly compressed with _Snappy_, and at this point measures it against `max data size` (20 MiB).
Expand Down
4 changes: 2 additions & 2 deletions modules/concept-docs/pages/concepts.adoc
Expand Up @@ -2,7 +2,7 @@
:navtitle: Concepts
:page-topic-type: landing-page

include::project-docs:partial$attributes.adoc[]


include::7.0@sdk:shared:partial$concepts.adoc[tag=concepts]
include::{version-server}@sdk:shared:partial$concepts.adoc[tag=concepts]

6 changes: 4 additions & 2 deletions modules/concept-docs/pages/data-model.adoc
Expand Up @@ -4,14 +4,16 @@
:page-topic-type: concept
:page-aliases: ROOT:core-operations, ROOT:datastructures

include::project-docs:partial$attributes.adoc[]

[abstract]
{description}
Several data structures are supported by the SDK, including map, list, queue, and set.


include::7.0@sdk:shared:partial$data-model.adoc[tag=intro]
include::{version-server}@sdk:shared:partial$data-model.adoc[tag=intro]

== Data Structures
== Data Structures

Data structures in Couchbase are similar in concept to data structures in Python:

Expand Down
4 changes: 3 additions & 1 deletion modules/concept-docs/pages/data-services.adoc
@@ -1 +1,3 @@
include::7.0@sdk:pages:partial$data-services.adoc[]
include::project-docs:partial$attributes.adoc[]

include::{version-server}@sdk:pages:partial$data-services.adoc[]
42 changes: 13 additions & 29 deletions modules/concept-docs/pages/documents.adoc
@@ -1,10 +1,12 @@
= Document
= Document
:description: Couchbase supports CRUD operations, various data structures, and binary documents.
:nav-title: Documents & Doc Ops
:page-topic-type: concept
//:page-aliases: ROOT:core-operations
:page-aliases: ROOT:documents,ROOT:documents-basics,ROOT:documents-atomic

include::project-docs:partial$attributes.adoc[]

[abstract]
{description}

Expand All @@ -30,7 +32,7 @@ Although query and path-based (Sub-Document) services are available, the simplic



include::7.0@sdk:shared:partial$documents.adoc[tag=document]
include::{version-server}@sdk:shared:partial$documents.adoc[tag=document]

== Primitive Key-Value Operations

Expand All @@ -43,9 +45,9 @@ get(docid)
remove(docid)
----

include::7.0@sdk:shared:partial$documents.adoc[tag=crud-overview]
include::{version-server}@sdk:shared:partial$documents.adoc[tag=crud-overview]

include::7.0@sdk:shared:partial$documents.adoc[tag=store-update]
include::{version-server}@sdk:shared:partial$documents.adoc[tag=store-update]

[NOTE]
====
Expand All @@ -56,15 +58,15 @@ If you wish to only modify certain parts of a document, you can use xref:subdocu
collection.mutate_in("customer123", [SD.upsert("fax", "311-555-0151")])
----

or xref:6.0@server:n1ql:n1ql-language-reference/update.adoc[N1QL UPDATE] to update documents based on specific query criteria:
or xref:{version-server}@server:n1ql:n1ql-language-reference/update.adoc[N1QL UPDATE] to update documents based on specific query criteria:

[source,sql]
----
update `default` SET sale_price = msrp * 0.75 WHERE msrp < 19.95;
----
====

include::7.0@sdk:shared:partial$documents.adoc[tag=get_generic]
include::{version-server}@sdk:shared:partial$documents.adoc[tag=get_generic]

[source,sql]
----
Expand All @@ -87,7 +89,7 @@ name, email = cb.retrieve_in('user:kingarthur', 'contact.name', 'contact.email')

// Counters

include::7.0@sdk:shared:partial$documents.adoc[tag=counters1]
include::{version-server}@sdk:shared:partial$documents.adoc[tag=counters1]

[source,python]
----
Expand All @@ -99,7 +101,7 @@ include::7.0@sdk:shared:partial$documents.adoc[tag=counters1]
51L
----

include::7.0@sdk:shared:partial$documents.adoc[tag=counters2]
include::{version-server}@sdk:shared:partial$documents.adoc[tag=counters2]

[source,python]
----
Expand All @@ -109,33 +111,15 @@ if should_increment_value(value):
cb.upsert('counter_id', value + increment_amount, cas=cas)
----

include::7.0@sdk:shared:partial$documents.adoc[tag=counters3]
include::{version-server}@sdk:shared:partial$documents.adoc[tag=counters3]


=== Use Cases

The SDK provides a high-level abstraction over the simple `incr()`/`decr()` of Couchbase Server's memcached binary protocol, using `collections.binary()`.
The SDK provides a high-level abstraction over the simple `incr()`/`decr()` of Couchbase Server's memcached binary protocol, using `collections.binary()`.
This enables you to work with counters using `get()` and `upsert()` operations -- allowing, _inter alia_, the use of durability options with the operations.
You will find several ways of working with counters https://docs.couchbase.com/sdk-api/couchbase-python-client/api/couchbase.html?highlight=incr#couchbase.collection.BinaryCollection.increment[in the API docs].


// Expiry
include::7.0@sdk:shared:partial$documents.adoc[tag=expiration]


////
include::7.0@sdk:shared:partial$documents.adoc[tag=]


include::7.0@sdk:shared:partial$documents.adoc[tag=]

include::7.0@sdk:shared:partial$documents.adoc[tag=]

include::7.0@sdk:shared:partial$documents.adoc[tag=]

include::7.0@sdk:shared:partial$documents.adoc[tag=]

include::7.0@sdk:shared:partial$documents.adoc[tag=]

include::7.0@sdk:shared:partial$documents.adoc[tag=]
////
include::{version-server}@sdk:shared:partial$documents.adoc[tag=expiration]
Expand Up @@ -3,6 +3,7 @@
:page-topic-type: concept
// :page-aliases: ROOT:failure-considerations,ROOT:durability,ROOT:enhanced-durability

include::project-docs:partial$attributes.adoc[]

[abstract]
{description}
Expand All @@ -11,16 +12,16 @@ Couchbase’s durability features include Synchronous Replication, and the possi
It is the responsibility of the development team and the software architect to evaluate the best choice for each use case.


include::7.0@sdk:shared:partial$durability-replication-failure-considerations.adoc[tag=intro]
include::{version-server}@sdk:shared:partial$durability-replication-failure-considerations.adoc[tag=intro]

include::7.0@sdk:shared:partial$durability-replication-failure-considerations.adoc[tag=syncrep]
include::7.0@sdk:shared:partial$durability-replication-failure-considerations.adoc[tag=syncrep3]
include::{version-server}@sdk:shared:partial$durability-replication-failure-considerations.adoc[tag=syncrep]
include::{version-server}@sdk:shared:partial$durability-replication-failure-considerations.adoc[tag=syncrep3]

include::7.0@sdk:shared:partial$durability-replication-failure-considerations.adoc[tag=older]
include::{version-server}@sdk:shared:partial$durability-replication-failure-considerations.adoc[tag=older]

include::7.0@sdk:shared:partial$durability-replication-failure-considerations.adoc[tag=performance]
include::{version-server}@sdk:shared:partial$durability-replication-failure-considerations.adoc[tag=performance]

// include::7.0@sdk:shared:partial$durability-replication-failure-considerations.adoc[tag=txns]
// include::{version-server}@sdk:shared:partial$durability-replication-failure-considerations.adoc[tag=txns]

// include::7.0@sdk:shared:partial$durability-replication-failure-considerations.adoc[tag=failover]
// include::{version-server}@sdk:shared:partial$durability-replication-failure-considerations.adoc[tag=failover]

4 changes: 3 additions & 1 deletion modules/concept-docs/pages/encryption.adoc
@@ -1 +1,3 @@
include::7.0@sdk:pages:partial$encryption.adoc[]
include::project-docs:partial$attributes.adoc[]

include::{version-server}@sdk:pages:partial$encryption.adoc[]
16 changes: 9 additions & 7 deletions modules/concept-docs/pages/errors.adoc
Expand Up @@ -2,25 +2,27 @@
:description: When the unexpected happens, take a step-by-step approach.
:nav-title: Errors & Diagnostics
:page-topic-type: concept
:page-aliases:
:page-aliases:

include::project-docs:partial$attributes.adoc[]

[abstract]
{description}


== General Approach to Python Exceptions

include::7.0@sdk:shared:partial$errors.adoc[tag=exception]
include::{version-server}@sdk:shared:partial$errors.adoc[tag=exception]

// include::7.0@sdk:shared:partial$errors.adoc[tag=ref]
// include::{version-server}@sdk:shared:partial$errors.adoc[tag=ref]

include::7.0@sdk:shared:partial$errors.adoc[tag=durability]
include::{version-server}@sdk:shared:partial$errors.adoc[tag=durability]

include::7.0@sdk:shared:partial$errors.adoc[tag=diag]
include::{version-server}@sdk:shared:partial$errors.adoc[tag=diag]

// Slow Operations Logging
include::7.0@sdk:shared:partial$errors.adoc[tag=observability]
include::{version-server}@sdk:shared:partial$errors.adoc[tag=observability]

// until opentelemetry release for link below, could add note on API to expose own tracing features?
// include::7.0@sdk:shared:partial$errors.adoc[tag=rto]
// include::{version-server}@sdk:shared:partial$errors.adoc[tag=rto]

4 changes: 3 additions & 1 deletion modules/concept-docs/pages/full-text-search-overview.adoc
@@ -1 +1,3 @@
include::7.0@sdk:pages:partial$search.adoc[]
include::project-docs:partial$attributes.adoc[]

include::{version-server}@sdk:pages:partial$search.adoc[]
10 changes: 6 additions & 4 deletions modules/concept-docs/pages/health-check.adoc
Expand Up @@ -4,15 +4,17 @@
:page-topic-type: concept
:page-aliases: ROOT:health-check

include::project-docs:partial$attributes.adoc[]

[abstract]
{description}


include::7.0@sdk:pages:partial$health-check.adoc[tag="intro"]
include::{version-server}@sdk:pages:partial$health-check.adoc[tag="intro"]

include::7.0@sdk:pages:partial$health-check.adoc[tag="users"]
include::{version-server}@sdk:pages:partial$health-check.adoc[tag="users"]

include::7.0@sdk:pages:partial$health-check.adoc[tag="ping"]
include::{version-server}@sdk:pages:partial$health-check.adoc[tag="ping"]

[source,javascript]
----
Expand Down Expand Up @@ -81,7 +83,7 @@ bucket.ping(services, (err, res) => {
*/
----

include::7.0@sdk:pages:partial$health-check.adoc[tag="diag"]
include::{version-server}@sdk:pages:partial$health-check.adoc[tag="diag"]


[source,javascript]
Expand Down