diff --git a/modules/ROOT/nav.adoc b/modules/ROOT/nav.adoc index 076ffd8f..07763da9 100644 --- a/modules/ROOT/nav.adoc +++ b/modules/ROOT/nav.adoc @@ -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 @@ -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] diff --git a/modules/concept-docs/pages/analytics-for-sdk-users.adoc b/modules/concept-docs/pages/analytics-for-sdk-users.adoc index 38cb891f..bfa89176 100644 --- a/modules/concept-docs/pages/analytics-for-sdk-users.adoc +++ b/modules/concept-docs/pages/analytics-for-sdk-users.adoc @@ -4,6 +4,8 @@ :page-topic-type: concept :page-aliases: analytics, +include::project-docs:partial$attributes.adoc[] + [abstract] {description} @@ -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]. diff --git a/modules/concept-docs/pages/buckets-and-clusters.adoc b/modules/concept-docs/pages/buckets-and-clusters.adoc index ec608133..30811f1d 100644 --- a/modules/concept-docs/pages/buckets-and-clusters.adoc +++ b/modules/concept-docs/pages/buckets-and-clusters.adoc @@ -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: @@ -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. //// diff --git a/modules/concept-docs/pages/certificate-based-authentication.adoc b/modules/concept-docs/pages/certificate-based-authentication.adoc index ee1693b0..7c02d688 100644 --- a/modules/concept-docs/pages/certificate-based-authentication.adoc +++ b/modules/concept-docs/pages/certificate-based-authentication.adoc @@ -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[] diff --git a/modules/concept-docs/pages/collections.adoc b/modules/concept-docs/pages/collections.adoc index 56e2b8cf..f442d174 100644 --- a/modules/concept-docs/pages/collections.adoc +++ b/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: @@ -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]. diff --git a/modules/concept-docs/pages/compression.adoc b/modules/concept-docs/pages/compression.adoc index 0dc342aa..5435a181 100644 --- a/modules/concept-docs/pages/compression.adoc +++ b/modules/concept-docs/pages/compression.adoc @@ -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} @@ -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). diff --git a/modules/concept-docs/pages/concepts.adoc b/modules/concept-docs/pages/concepts.adoc index 8a83d27a..be183f5f 100644 --- a/modules/concept-docs/pages/concepts.adoc +++ b/modules/concept-docs/pages/concepts.adoc @@ -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] diff --git a/modules/concept-docs/pages/data-model.adoc b/modules/concept-docs/pages/data-model.adoc index 88b52131..c1ef4be9 100644 --- a/modules/concept-docs/pages/data-model.adoc +++ b/modules/concept-docs/pages/data-model.adoc @@ -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: diff --git a/modules/concept-docs/pages/data-services.adoc b/modules/concept-docs/pages/data-services.adoc index c73b889d..27302b37 100644 --- a/modules/concept-docs/pages/data-services.adoc +++ b/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[] diff --git a/modules/concept-docs/pages/documents.adoc b/modules/concept-docs/pages/documents.adoc index cf48680a..71a8e56b 100644 --- a/modules/concept-docs/pages/documents.adoc +++ b/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} @@ -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 @@ -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] ==== @@ -56,7 +58,7 @@ 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] ---- @@ -64,7 +66,7 @@ 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] ---- @@ -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] ---- @@ -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] ---- @@ -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] diff --git a/modules/concept-docs/pages/durability-replication-failure-considerations.adoc b/modules/concept-docs/pages/durability-replication-failure-considerations.adoc index b73cbc9c..9bbcf718 100644 --- a/modules/concept-docs/pages/durability-replication-failure-considerations.adoc +++ b/modules/concept-docs/pages/durability-replication-failure-considerations.adoc @@ -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} @@ -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] diff --git a/modules/concept-docs/pages/encryption.adoc b/modules/concept-docs/pages/encryption.adoc index 548657d7..11b19d8a 100644 --- a/modules/concept-docs/pages/encryption.adoc +++ b/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[] diff --git a/modules/concept-docs/pages/errors.adoc b/modules/concept-docs/pages/errors.adoc index 016adddb..1af12a2a 100644 --- a/modules/concept-docs/pages/errors.adoc +++ b/modules/concept-docs/pages/errors.adoc @@ -2,7 +2,9 @@ :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} @@ -10,17 +12,17 @@ == 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] diff --git a/modules/concept-docs/pages/full-text-search-overview.adoc b/modules/concept-docs/pages/full-text-search-overview.adoc index cbda5bfc..7e6e28b3 100644 --- a/modules/concept-docs/pages/full-text-search-overview.adoc +++ b/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[] diff --git a/modules/concept-docs/pages/health-check.adoc b/modules/concept-docs/pages/health-check.adoc index 79651ff2..d62f1a7c 100644 --- a/modules/concept-docs/pages/health-check.adoc +++ b/modules/concept-docs/pages/health-check.adoc @@ -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] ---- @@ -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] diff --git a/modules/concept-docs/pages/n1ql-query.adoc b/modules/concept-docs/pages/n1ql-query.adoc index 33e05fd9..8cdef450 100644 --- a/modules/concept-docs/pages/n1ql-query.adoc +++ b/modules/concept-docs/pages/n1ql-query.adoc @@ -4,15 +4,17 @@ :page-topic-type: concept :page-aliases: ROOT:n1ql-query, +include::project-docs:partial$attributes.adoc[] + [abstract] {description} -include::7.0@sdk:shared:partial$n1ql-queries.adoc[tag=intro] +include::{version-server}@sdk:shared:partial$n1ql-queries.adoc[tag=intro] // Prepared Statements for Query Optimization -include::7.0@sdk:shared:partial$n1ql-queries.adoc[tag=prepared] +include::{version-server}@sdk:shared:partial$n1ql-queries.adoc[tag=prepared] For the Python SDK, the `adhoc` parameter should be set to `false` for a plan to be prepared, or a prepared plan to be reused. Do not turn off the `adhoc` flag for _every_ query to Server 6.0 and earlier, since only a finite number of query plans (currently 5000) can be stored in the SDK. @@ -20,19 +22,22 @@ Do not turn off the `adhoc` flag for _every_ query to Server 6.0 and earlier, si [source,python] ---- result = cluster.query( - "SELECT x.* FROM `default` WHERE x.Type=$1", - 'User', QueryOptions(adhoc=false)) + """SELECT airportname, city + FROM \`travel-sample\`.inventory.airport + WHERE city=$1;""", + 'London', QueryOptions(adhoc=false)) ---- +// NB: xref:6.5@server as document does not exist in 7.0 branch. CAUTION: *When running an application using Prepared Statements through the Python SDK* -- if you plan to upgrade Couchbase Server from 6.0.x or earlier to 6.5.0 or later, and are running a version of the Python SDK with an underlying LCB prior to 2.10.6, you will need to xref:6.5@server:install:upgrade-strategy-for-features.adoc#prepared-statements[restart the app or otherwise work around] a change in the Server's behaviour. == Indexes -The Couchbase query service makes use of xref:6.5@server:learn:services-and-indexes/indexes/indexes.adoc[_indexes_] in order to do its work. -Indexes replicate subsets of documents from data nodes over to index nodes, -allowing specific data (for example, specific document properties) to be retrieved quickly, -and to distribute load away from data nodes in xref:6.5@server:learn:services-and-indexes/services/services.adoc[MDS] topologies. +The Couchbase query service makes use of xref:{version-server}@server:learn:services-and-indexes/indexes/indexes.adoc[_indexes_] in order to do its work. +Indexes replicate subsets of documents from data nodes over to index nodes, +allowing specific data (for example, specific document properties) to be retrieved quickly, +and to distribute load away from data nodes in xref:{version-server}@server:learn:services-and-indexes/services/services.adoc[MDS] topologies. [IMPORTANT] In order to make a bucket queryable, it must have at least one index defined. @@ -50,25 +55,28 @@ You can also define indexes over given document fields and then use those fields [source,n1ql] ---- -CREATE INDEX ix_name ON `users`(name); -CREATE INDEX ix_email ON `users`(email); +CREATE INDEX ix_name ON `travel-sample`.inventory.hotel(name); +CREATE INDEX ix_email ON `travel-sample`.inventory.hotel(email); ---- -This would allow you to query the _users_ bucket regarding a document's `name` or `email` properties, thus: +This would allow you to query the _travel-sample_ bucket's hotel collection regarding a document's `name` or `email` properties, thus: [source,n1ql] ---- -SELECT name, email FROM `users` WHERE name="Monty Python" OR email="monty@python.org"; +SELECT name, email +FROM `travel-sample`.inventory.hotel +WHERE name="Glasgow Grand Central" OR email="grandcentralhotel@example.com"; ---- Indexes help improve the performance of a query. -When an index includes the actual values of all the fields specified in the query, +When an index includes the actual values of all the fields specified in the query, the index _covers_ the query, and eliminates the need to fetch the actual values from the Data Service. An index, in this case, is called a _covering index_, and the query is called a _covered_ query. -For more information, see xref:6.5@server:n1ql:n1ql-language-reference/covering-indexes.adoc[Covering Indexes]. +For more information, see xref:{version-server}@server:n1ql:n1ql-language-reference/covering-indexes.adoc[Covering Indexes]. You can also create and define indexes in the SDK using: +// TODO: Python example [source,csharp] ---- var bucketManager = bucket.CreateManager(); @@ -86,18 +94,19 @@ The deferred indexes can be built together, rather than having to re-scan the en [source,sql] ---- -CREATE PRIMARY INDEX ON `users` WITH {"defer_build": true}; -CREATE INDEX ix_name ON `users`(name) WITH {"defer_build": true}; -CREATE INDEX ix_email ON `users`(email) WITH {"defer_build": true}; -BUILD INDEX ON `users`(`#primary`, `ix_name`, `ix_email`); +CREATE PRIMARY INDEX ON `travel-sample`.inventory.hotel WITH {"defer_build": true}; +CREATE INDEX ix_name ON `travel-sample`.inventory.hotel(name) WITH {"defer_build": true}; +CREATE INDEX ix_email ON `travel-sample`.inventory.hotel(email) WITH {"defer_build": true}; +BUILD INDEX ON `travel-sample`.inventory.hotel(`#primary`, `ix_name`, `ix_email`); ---- The indexes are not built until the `BUILD INDEX` statement is executed. -At this point, the server scans all of the documents in the `users` bucket, +At this point, the server scans all of the documents in the `users` bucket, and indexes it for all of the applicable indexes (in this case, those that have a `name` or `email` field). Building deferred indexes can also be done via the SDK: +// TODO: Python example [source,csharp] ---- var bucketManager = bucket.CreateManager(); @@ -110,11 +119,11 @@ await bucketManager.WatchN1qlIndexes(new List { "ix_name", "ix_email", " // Index Consistency -include::7.0@sdk:shared:partial$n1ql-queries.adoc[tag=index-consistency] +include::{version-server}@sdk:shared:partial$n1ql-queries.adoc[tag=index-consistency] The following options are available: -include::7.0@server:learn:page$services-and-indexes/indexes/index-replication.adoc[tag=scan_consistency] +include::{version-server}@server:learn:page$services-and-indexes/indexes/index-replication.adoc[tag=scan_consistency] //// * `not_bounded`: Executes the query immediately, without requiring any consistency for the query. If index-maintenance is running behind, out-of-date results may be returned. @@ -127,6 +136,7 @@ For N1QL, the default consistency is `not_bounded`. //// Consider the following snippet: +// TODO: Python example [source,csharp] ---- @@ -149,6 +159,7 @@ The query is issued immediately after document creation, and in this case the qu If the above code is modified to use _RequestPlus_, query processing will wait until all updates have been processed and recalculated into the index from the point in time the query was received: +// TODO: Python example [source,csharp] ---- var query = new QueryRequest("SELECT name, email, random, META(default).id FROM default WHERE $1 IN name'") @@ -160,44 +171,4 @@ var result = bucket.Query(query); ---- This gives the application developer more control over the balance between performance (latency) and consistency, -and allows optimization on a case-by-case basis. - - - - -//// -** Awaiting LINQ updates ** - -== Building Statements with LINQ - -[NOTE] -LINQ is a community project. -Although it works well with Couchbase, it is not part of the officially-supported product. - -LINQ (Language Integrated Query), is a powerful way to guide you in building your statements: -you obtain Type safety and auto completion of relevant methods and N1QL clauses. -It implements https://msdn.microsoft.com/en-us/library/mt693024.aspx[Microsoft’s language integrated query extensions to the C# language], -and is similar to other LINQ providers like Linq2SQL, Entity Framework and NHibernate. -The difference is that it emits N1QL in place of SQL. -If you have used any other LINQ provider, you will find its familiarity and consistency make it an easy transition. - -_Linq2Couchbase_, the LINQ provider for the Couchbase .NET SDK, is a stand-alone project which depends on Couchbase .NET SDK -and can be found on https://www.nuget.org/packages/linq2Couchbase[NuGet] -- and by using the NuGet package manager to include the dependency: - -[source] ----- -PM> Install-Package Linq2Couchbase ----- - -Once you have included the dependency, you can construct queries just like any other LINQ provider in a SQL-like fashion. Nearly all N1QL statements and functions are supported, for example: - -* INNER, LEFT Outer, and Index JOINs -* Math and Date functions -* Filtering, projections and sorting -* Grouping and aggregations -* META keyword, NEST and UNNEST -* Etc. - -In addition to N1QL language features, Linq2Coucbase supports ORM features like Change-tracking, and mapping of JSON fields to keys and other POCO properties. -The provider’s core object is the `BucketContext`, which is a Unit of Work (UoW) type object for performing querying and mutations on a per request basis. -//// +and allows optimization on a case-by-case basis. \ No newline at end of file diff --git a/modules/concept-docs/pages/nonjson.adoc b/modules/concept-docs/pages/nonjson.adoc index ee9be3ad..98bf314a 100644 --- a/modules/concept-docs/pages/nonjson.adoc +++ b/modules/concept-docs/pages/nonjson.adoc @@ -4,10 +4,12 @@ :page-aliases: ROOT:nonjson :page-topic-type: concept +include::project-docs:partial$attributes.adoc[] + [abstract] {description} -include::7.0@sdk:shared:partial$nonjson.adoc[tag=intro] +include::{version-server}@sdk:shared:partial$nonjson.adoc[tag=intro] -include::7.0@sdk:shared:partial$nonjson.adoc[tag=using] +include::{version-server}@sdk:shared:partial$nonjson.adoc[tag=using] diff --git a/modules/concept-docs/pages/rbac.adoc b/modules/concept-docs/pages/rbac.adoc index 431b3308..a3d7b2c1 100644 --- a/modules/concept-docs/pages/rbac.adoc +++ b/modules/concept-docs/pages/rbac.adoc @@ -1,2 +1,4 @@ -include::7.0@sdk:pages:partial$rbac.adoc[] +include::project-docs:partial$attributes.adoc[] + +include::{version-server}@sdk:pages:partial$rbac.adoc[] diff --git a/modules/concept-docs/pages/response-time-observability.adoc b/modules/concept-docs/pages/response-time-observability.adoc index 10122084..711e7ed4 100644 --- a/modules/concept-docs/pages/response-time-observability.adoc +++ b/modules/concept-docs/pages/response-time-observability.adoc @@ -4,7 +4,9 @@ :page-topic-type: concept :page-aliases: ROOT:threshold-logging.adoc +include::project-docs:partial$attributes.adoc[] + [abstract] {description} -include::7.0@sdk:shared:partial$rto.adoc[tag=rto] +include::{version-server}@sdk:shared:partial$rto.adoc[tag=rto] diff --git a/modules/concept-docs/pages/sdk-user-management-overview.adoc b/modules/concept-docs/pages/sdk-user-management-overview.adoc index f53dde24..2e6d4e71 100644 --- a/modules/concept-docs/pages/sdk-user-management-overview.adoc +++ b/modules/concept-docs/pages/sdk-user-management-overview.adoc @@ -1 +1,3 @@ -include::7.0@sdk:pages:partial$user-management.adoc[] +include::project-docs:partial$attributes.adoc[] + +include::{version-server}@sdk:pages:partial$user-management.adoc[] diff --git a/modules/concept-docs/pages/subdocument-operations.adoc b/modules/concept-docs/pages/subdocument-operations.adoc index aa237ef8..4ee44210 100644 --- a/modules/concept-docs/pages/subdocument-operations.adoc +++ b/modules/concept-docs/pages/subdocument-operations.adoc @@ -1 +1,3 @@ -include::7.0@sdk:pages:partial$subdoc.adoc[] +include::project-docs:partial$attributes.adoc[] + +include::{version-server}@sdk:pages:partial$subdoc.adoc[] diff --git a/modules/concept-docs/pages/understanding-views.adoc b/modules/concept-docs/pages/understanding-views.adoc index 43869bb9..0af564cc 100644 --- a/modules/concept-docs/pages/understanding-views.adoc +++ b/modules/concept-docs/pages/understanding-views.adoc @@ -1 +1,3 @@ -include::7.0@sdk:pages:partial$views.adoc[] +include::project-docs:partial$attributes.adoc[] + +include::{version-server}@sdk:pages:partial$views.adoc[] diff --git a/modules/concept-docs/pages/xattr.adoc b/modules/concept-docs/pages/xattr.adoc index af28d4fd..fd5c297e 100644 --- a/modules/concept-docs/pages/xattr.adoc +++ b/modules/concept-docs/pages/xattr.adoc @@ -4,15 +4,18 @@ :page-topic-type: concept :page-aliases: sdk-xattr-overview,ROOT:sdk-xattr-overview +include::project-docs:partial$attributes.adoc[] + [abstract] {description} -include::7.0@sdk:shared:partial$sdk-xattr-overview.adoc[tag=intro_extended_attributes] +include::{version-server}@sdk:shared:partial$sdk-xattr-overview.adoc[tag=intro_extended_attributes] -include::7.0@sdk:shared:partial$sdk-xattr-overview.adoc[tag=using_extended_attributes] +include::{version-server}@sdk:shared:partial$sdk-xattr-overview.adoc[tag=using_extended_attributes] -include::7.0@sdk:shared:partial$sdk-xattr-overview.adoc[tag=virtual_extended_attributes] +include::{version-server}@sdk:shared:partial$sdk-xattr-overview.adoc[tag=virtual_extended_attributes] +// TODO: Python example [source,java] ---- bucket.lookupIn(key).get("$document.exptime", new SubdocOptionsBuilder().xattr(true)).execute() diff --git a/modules/hello-world/examples/hello_world_t.py b/modules/hello-world/examples/hello_world_t.py index 5fa664c8..a276c491 100644 --- a/modules/hello-world/examples/hello_world_t.py +++ b/modules/hello-world/examples/hello_world_t.py @@ -20,13 +20,15 @@ cb = cluster.bucket('travel-sample') # end::bucket[] +# tag::collection[] +cb_coll = cb.scope("inventory").collection("airline") +# end::collection[] + # tag::default-collection[] -# get a reference to the default collection -cb_coll = cb.default_collection() +# get a reference to the default collection, required for older Couchbase server versions +cb_coll_default = cb.default_collection() # end::default-collection[] - - # tag::upsert-func[] def upsert_document(doc): print("\nUpsert CAS: ") @@ -55,9 +57,9 @@ def get_airline_by_key(key): def lookup_by_callsign(cs): print("\nLookup Result: ") try: - sql_query = 'SELECT VALUE name FROM `travel-sample` WHERE type = "airline" AND callsign = $1' + sql_query = 'SELECT VALUE name FROM `travel-sample`.inventory.airline WHERE callsign = $1' row_iter = cluster.query( - sql_query, + sql_query, QueryOptions(positional_parameters=[cs])) for row in row_iter: print(row) except Exception as e: diff --git a/modules/hello-world/pages/overview.adoc b/modules/hello-world/pages/overview.adoc index bb2b6eff..7dc6f521 100644 --- a/modules/hello-world/pages/overview.adoc +++ b/modules/hello-world/pages/overview.adoc @@ -13,7 +13,7 @@ [.column] ====== {empty} [.content] -The Couchbase Python SDK allows Python applications to access a Couchbase cluster. +The Couchbase Python SDK allows Python applications to access a Couchbase cluster. The Python SDK uses the high-performance C library libcouchbase to handle communicating to the cluster over Couchbase's binary protocols. @@ -67,11 +67,11 @@ And take a look at the xref:howtos:working-with-collections.adoc[developer previ .Practical Howto Docs [.content] -Connect to our services -- xref:howtos:kv-operations.adoc[data (KV)]; -xref:howtos:n1ql-queries-with-sdk.adoc[Query]; -xref:howtos:full-text-searching-with-sdk.adoc[Search]; +Connect to our services -- xref:howtos:kv-operations.adoc[data (KV)]; +xref:howtos:n1ql-queries-with-sdk.adoc[Query]; +xref:howtos:full-text-searching-with-sdk.adoc[Search]; xref:howtos:analytics-using-sdk.adoc[Analytics] -- -// ; xref:howtos:view-queries-with-sdk.adoc[Views] -- +// ; xref:howtos:view-queries-with-sdk.adoc[Views] -- and the xref:howtos:subdocument-operations.adoc[Sub-Document API]. [.column] @@ -98,10 +98,10 @@ The 3.x Python SDK introduces comprehensive https://www.python.org/dev/peps/pep- .About [.content] -Those useful nuts-and-bolts guides to -xref:project-docs:compatibility.adoc[compatibility tables]; -xref:project-docs:sdk-release-notes.adoc[release notes]; -xref:project-docs:get-involved.adoc[contribution guide]; and the +Those useful nuts-and-bolts guides to +xref:project-docs:compatibility.adoc[compatibility tables]; +xref:project-docs:sdk-release-notes.adoc[release notes]; +xref:project-docs:get-involved.adoc[contribution guide]; and the xref:project-docs:migrating-sdk-code-to-3.n.adoc[migration guide] for moving to the 3.x API. [.column] diff --git a/modules/hello-world/pages/start-using-sdk.adoc b/modules/hello-world/pages/start-using-sdk.adoc index 3f87233a..b5e60c17 100644 --- a/modules/hello-world/pages/start-using-sdk.adoc +++ b/modules/hello-world/pages/start-using-sdk.adoc @@ -11,7 +11,7 @@ It depends on the C SDK, _libcouchbase_, (included automatically) which it uses // tag::prep[] -The Couchbase Python SDK 3.x is a complete rewrite of the API, reducing the number of overloads to present a simplified surface area, and adding support for future Couchbase Server features like Collections and Scopes (available in Couchbase Server 6.5 & 6.6 as a xref:concept-docs:collections.adoc[developer preview]). +The Couchbase Python SDK 3.x is a complete rewrite of the API, reducing the number of overloads to present a simplified surface area, and adding support for Couchbase Server features like xref:concept-docs:collections.adoc[Collections and Scopes] (available from Couchbase Server 7.0). The 3.x Python SDK introduces comprehensive https://www.python.org/dev/peps/pep-0484/[PEP-484] style type annotations. @@ -43,8 +43,8 @@ $ python3 -m pip install --upgrade pip setuptools wheel == Installing on Linux -[{tabs}] -==== +[{tabs}] +==== Debian and Ubuntu:: + -- @@ -80,7 +80,7 @@ During first-time setup: $ sudo yum install gcc gcc-c++ python3-devel python3-pip cmake ---- -TIP: You may need to update your installed version of CMake. +TIP: You may need to update your installed version of CMake. For example, by following the steps https://idroot.us/install-cmake-centos-8[here^]. For TLS/SSL support (optional): @@ -105,12 +105,12 @@ It may be found in the https://fedoraproject.org/wiki/EPEL[EPEL^] repository. == Installation on Mac OS X -The following example uses the Python supplied by the Homebrew package manager and not the vendor-supplied Python which ships with OS X. +The following example uses the Python supplied by the Homebrew package manager and not the vendor-supplied Python which ships with OS X. -To install the library on Mac OS X, first install Homebrew: http://brew.sh/[Homebrew^]. +To install the library on Mac OS X, first install Homebrew: http://brew.sh/[Homebrew^]. Once _Homebrew_ is configured: -NOTE: Later versions of Mac OS X break the python3 homebrew installer. +NOTE: Later versions of Mac OS X break the python3 homebrew installer. Simple mitigating steps may be found https://stackoverflow.com/questions/47255517/brew-install-python3-didnt-install-pip3[here^]. Best practice is to use a Python virtual environment such as _venv_ or _pyenv_ to manage multible versions of Python, but in cases where this is not practicable follow the `brew` steps below, and also modify your `$PATH` as shown. @@ -173,7 +173,7 @@ If you require a version without OpenSSL support, or that doesn't have a suitabl At this point we want to transition from the terminal to your code editor of choice. -Let's now create an empty file named `cb-test.py` and walk through adding code step-by-step: +Let's now create an empty file named `cb-test.py` and walk through adding code step-by-step: * Connect to a cluster, bucket, and default collection; * Add and retrieve a new document; @@ -181,9 +181,9 @@ Let's now create an empty file named `cb-test.py` and walk through adding code s === Prerequisites -As well as the Python SDK (see above), and a running instance of Couchbase Server, you will need to load up the Travel Sample Bucket -using either the xref:6.6@server:manage:manage-settings/install-sample-buckets.adoc#install-sample-buckets-with-the-ui[Web interface] -or the xref:6.6@server:manage:manage-settings/install-sample-buckets.adoc#install-sample-buckets-with-the-cli[command line]. +As well as the Python SDK (see above), and a running instance of Couchbase Server, you will need to load up the Travel Sample Bucket +using either the xref:{version-server}@server:manage:manage-settings/install-sample-buckets.adoc#install-sample-buckets-with-the-ui[Web interface] +or the xref:{version-server}@server:manage:manage-settings/install-sample-buckets.adoc#install-sample-buckets-with-the-cli[command line]. === Connection @@ -194,11 +194,11 @@ The basic imports and connection string that you'll need are given below -- for include::../examples/hello_world_t.py[tag=connect] ---- -Couchbase uses xref:6.5@server:learn:security/roles.adoc[Role Based Access Control (RBAC)] to control access to resources. -For the sake of this example, we are connecting to Couchbase using the _Full Admin_ role created during the installation of our Couchbase Server. +Couchbase uses xref:{version-server}@server:learn:security/roles.adoc[Role Based Access Control (RBAC)] to control access to resources. +For the sake of this example, we are connecting to Couchbase using the _Full Admin_ role created during the installation of our Couchbase Server. The connection is being made to a single Couchbase node, running locally. -Couchbase RBAC is fully described in the section xref:6.5@server:manage:manage-security/manage-users-and-roles.adoc[Authorization]. +Couchbase RBAC is fully described in the section xref:{version-server}@server:manage:manage-security/manage-users-and-roles.adoc[Authorization]. An _authenticator_, containing username and password, should be defined, and then passed to the cluster. Following successful authentication, the bucket can be opened: @@ -215,12 +215,18 @@ See xref:howtos:managing-connections.adoc[Managing Connections] for more connect [source,python,indent=0] ---- -include::../examples/hello_world_t.py[tag=default-collection] +include::../examples/hello_world_t.py[tag=collection] ---- -The latest Couchbase Server release (6.5), brings a limited _Developer Preview_ of Collections, allowing Documents to be grouped by purpose or theme, according to a specified _Collection_. -For our "Hello Couchbase" example we will simply use `DefaultCollection`, rather than a specific collection, which includes all documents in a bucket, and is forwards and backwards compatible with all supported versions of Couchbase Server. -Once the _Collection_ feature is generally available, the best practice will be to group documents into collections by type. +The 3.2 SDK is ready for the introduction of xref:concept-docs:collections.adoc[Collections] in the xref:{version-server}@server:introduction:whats-new.adoc#whats-new-server-700[7.0 release] of the Couchbase Data Platform. +The latest release, Couchbase Server 7.0, brings Collections, allowing Documents to be grouped by purpose or theme, according to specified _Scope_. + +NOTE: This feature was previously available as a _developer preview_ from Couchbase Server 6.6. _When connecting to a 6.6 cluster or earlier_, we must use the `DefaultCollection`, which covers the whole Bucket. + +[source,python,indent=0] +---- +include::../examples/hello_world_t.py[tag=default-collection] +---- === Document Addition and Retrieval @@ -294,13 +300,13 @@ The results you should expect are as follows: [source,console] ---- -Upsert CAS: +Upsert CAS: 1598469741559152640 -Get Result: +Get Result: {'type': 'airline', 'id': 8091, 'callsign': 'CBS', 'iata': None, 'icao': None, 'name': 'Couchbase Airways'} -Lookup Result: +Lookup Result: Couchbase Airways ---- diff --git a/modules/hello-world/pages/webui-cli-access.adoc b/modules/hello-world/pages/webui-cli-access.adoc index aa86b096..f97dba80 100644 --- a/modules/hello-world/pages/webui-cli-access.adoc +++ b/modules/hello-world/pages/webui-cli-access.adoc @@ -1 +1,3 @@ -include::7.0@sdk:pages:partial$webui-cli-access.adoc[] +include::project-docs:partial$attributes.adoc[] + +include::{version-server}@sdk:pages:partial$webui-cli-access.adoc[] diff --git a/modules/howtos/examples/n1ql_ops.py b/modules/howtos/examples/n1ql_ops.py index 6e823bb4..44d8b75c 100644 --- a/modules/howtos/examples/n1ql_ops.py +++ b/modules/howtos/examples/n1ql_ops.py @@ -15,7 +15,7 @@ try: result = cluster.query( - "SELECT * FROM `travel-sample` LIMIT 10", QueryOptions(metrics=True)) + "SELECT * FROM `travel-sample`.inventory.airport LIMIT 10", QueryOptions(metrics=True)) for row in result.rows(): print("Found row: {}".format(row)) @@ -31,31 +31,31 @@ # tag::positional[] result = cluster.query( - "SELECT ts.* FROM `travel-sample` ts WHERE ts.`type`=$1 LIMIT 10", - "hotel") + "SELECT ts.* FROM `travel-sample`.inventory.airport WHERE city=$1", + "San Jose") # end::positional[] # tag::positional_options[] result = cluster.query( - "SELECT ts.* FROM `travel-sample` ts WHERE st.`type`=$1 LIMIT 10", - QueryOptions(positional_parameters=["hotel"])) + "SELECT ts.* FROM `travel-sample`.inventory.airport WHERE city=$1", + QueryOptions(positional_parameters=["San Jose"])) # end::positional_options[] # tag::named_kwargs[] result = cluster.query( - "SELECT ts.* FROM `travel-sample` ts WHERE ts.`type`=$type LIMIT 10", - type='hotel') + "SELECT ts.* FROM `travel-sample`.inventory.airport WHERE city=$city", + city='San Jose') # end::named_kwargs[] # tag::named_options[] result = cluster.query( - "SELECT ts.* FROM `travel-sample` ts WHERE ts.`type`=$type LIMIT 10", - QueryOptions(named_parameters={"type": "hotel"})) + "SELECT ts.* FROM `travel-sample`.inventory.airport WHERE city=$city", + QueryOptions(named_parameters={"city": "San Jose"})) # end::named_options[] # tag::iterating[] result = cluster.query( - "SELECT ts.* FROM `travel-sample` ts WHERE ts.`type`='airline' LIMIT 10") + "SELECT ts.* FROM `travel-sample`.inventory.airline LIMIT 10") # iterate over rows for row in result: @@ -76,7 +76,7 @@ # tag::scan_consistency[] result = cluster.query( - "SELECT ts.* FROM `travel-sample` ts WHERE ts.`type`='airline' LIMIT 10", + "SELECT ts.* FROM `travel-sample`.inventory.airline LIMIT 10", QueryOptions(scan_consistency=QueryScanConsistency.REQUEST_PLUS)) # end::scan_consistency[] @@ -97,20 +97,20 @@ ms = MutationState(res) result = cluster.query( - "SELECT ts.* FROM `travel-sample` ts WHERE ts.`type`='airline' LIMIT 10", + "SELECT ts.* FROM `travel-sample`.inventory.airline LIMIT 10", QueryOptions(consistent_with=ms)) # end::ryow[] # tag::client_context_id[] result = cluster.query( - "SELECT ts.* FROM `travel-sample` ts WHERE ts.`type`='hotel' LIMIT 10", + "SELECT ts.* FROM `travel-sample`.inventory.hotel LIMIT 10", QueryOptions(client_context_id="user-44{}".format(uuid.uuid4()))) # end::client_context_id[] # tag::read_only[] result = cluster.query( - "SELECT ts.* FROM `travel-sample` ts WHERE ts.`type`='hotel' LIMIT 10", + "SELECT ts.* FROM `travel-sample`.inventory.hotel LIMIT 10", QueryOptions(read_only=True)) # end::read_only[] diff --git a/modules/howtos/pages/analytics-using-sdk.adoc b/modules/howtos/pages/analytics-using-sdk.adoc index 761fe001..612b1722 100644 --- a/modules/howtos/pages/analytics-using-sdk.adoc +++ b/modules/howtos/pages/analytics-using-sdk.adoc @@ -9,16 +9,18 @@ :example-source: 3.2@python-sdk:howtos:example$analytics_ops.py :example-source-lang: Python +include::project-docs:partial$attributes.adoc[] + [abstract] {description} -For complex and long-running queries, involving large ad hoc join, set, aggregation, and grouping operations, the Couchbase Data Platform offers the xref:7.0@server:analytics:introduction.adoc[Couchbase Analytics Service (CBAS)]. +For complex and long-running queries, involving large ad hoc join, set, aggregation, and grouping operations, the Couchbase Data Platform offers the xref:{version-server}@server:analytics:introduction.adoc[Couchbase Analytics Service (CBAS)]. This is the analytic counterpart to our xref:n1ql-queries-with-sdk.adoc[operational data focussed Query Service]. The analytics service is available in Couchbase Data Platform 6.0 and later. == Getting Started -After familiarizing yourself with our xref:7.0@server:analytics:primer-beer.adoc[introductory primer], +After familiarizing yourself with our xref:{version-server}@server:analytics:primer-beer.adoc[introductory primer], in particular creating a dataset and linking it to a bucket, try Couchbase Analytics using the Python SDK. Intentionally, the API for analytics is nearly identical to that of the query service. diff --git a/modules/howtos/pages/caching-example.adoc b/modules/howtos/pages/caching-example.adoc index d87ad536..cd623931 100644 --- a/modules/howtos/pages/caching-example.adoc +++ b/modules/howtos/pages/caching-example.adoc @@ -3,11 +3,13 @@ :navtitle: KV Caching Example :page-topic-type: howto +include::project-docs:partial$attributes.adoc[] + [abstract] {description} -This example uses https://pypi.org/project/Flask/[Flask] as a web-framework for a Python REST API. -Flask has no direct support for async, but another code sample is available demonstrating this whole application using the Couchbase async API https://github.com/couchbase/docs-sdk-python/blob/release/3.1/modules/howtos/examples/caching_fastapi.py[here]. +This example uses https://pypi.org/project/Flask/[Flask] as a web-framework for a Python REST API. +Flask has no direct support for async, but another code sample is available demonstrating this whole application using the Couchbase async API https://github.com/couchbase/docs-sdk-python/blob/release/3.1/modules/howtos/examples/caching_fastapi.py[here]. You can also find the https://github.com/couchbase/docs-sdk-python/blob/release/3.1/modules/howtos/examples/caching_flask.py[full code for _this_ example here]. @@ -27,14 +29,14 @@ include::howtos:example$caching_flask.py[tag=get] include::howtos:example$caching_flask.py[tag=post] ---- -This is the simplest API we can make -- allowing us to set and get arbitrary JSON from any key we specify. +This is the simplest API we can make -- allowing us to set and get arbitrary JSON from any key we specify. We also include the `expiry` parameter, which will automatically delete the document (invalidate the cache) after a set amount of time. == Cache Miss -There are many ways this can and could be improved upon for real world use. -What happens in the case of a cache miss? +There are many ways this can and could be improved upon for real world use. +What happens in the case of a cache miss? With this code, we handle the `DocumentNotFoundException` and respond with a HTTP 404. [source,python] @@ -44,7 +46,7 @@ include::howtos:example$caching_flask.py[tag=get] == Error Handling -We can also improve the POST function to deal with some of the errors it may encounter. +We can also improve the POST function to deal with some of the errors it may encounter. Even if something unexpected happens, we can still be helpful by including the error in the 500 response, and by catching any `CouchbaseException` as a fallback: [source,python] @@ -70,6 +72,6 @@ include::howtos:example$caching_flask.py[tag=delete] * You can find the full contextualized code from this sample https://github.com/couchbase/docs-sdk-python/blob/release/3.1/modules/howtos/examples/caching_flask.py[here]. -* Selecting an xref:6.5@server:learn:buckets-memory-and-storage/buckets.adoc#bucket-types[ephemeral or Memcached bucket] for the advantages of purely in-memory storage may make sense as a design decision. +* Selecting an xref:{version-server}@server:learn:buckets-memory-and-storage/buckets.adoc#bucket-types[ephemeral or Memcached bucket] for the advantages of purely in-memory storage may make sense as a design decision. * A webinar, a whitepaper, and other high-level information on choosing Couchbase as a caching layer is https://www.couchbase.com/caching-comparison[on the main Couchbase website]. diff --git a/modules/howtos/pages/collecting-information-and-logging.adoc b/modules/howtos/pages/collecting-information-and-logging.adoc index ecace4ef..174913a0 100644 --- a/modules/howtos/pages/collecting-information-and-logging.adoc +++ b/modules/howtos/pages/collecting-information-and-logging.adoc @@ -5,6 +5,8 @@ :page-aliases: logging :page-aliases: event-bus-metrics,logging +include::project-docs:partial$attributes.adoc[] + [abstract] {description} @@ -65,13 +67,15 @@ Increase the log level for greater verbosity (more information) in the logs: == Log Redaction -Redacting logs is a two-stage process. +Redacting logs is a two-stage process. If you want to redact client logs (for example before handing them off to the Couchbase Support team) you first need to enable log redaction in your application. This is done through the https://docs.couchbase.com/sdk-api/couchbase-python-client/api/couchbase.html?highlight=log_redaction[`ClusterOptions` to the Cluster object], setting `log_redaction` to `True`. - -Once the SDK writes the logs with the tags to a file, you can then use the xref:6.5@server:cli:cbcli/cblogredaction.adoc[`cblogredaction` tool] to obfuscate the log. -* You may wish to read more on Log Redaction xref:6.5@server:manage:manage-logging/manage-logging.adoc#understanding_redaction[in the Server docs]. +Once the SDK writes the logs with the tags to a file, you can then use the +xref:{version-server}@server:cli:cbcli/cblogredaction.adoc[`cblogredaction` tool] to obfuscate the log. + +* You may wish to read more on Log Redaction +xref:{version-server}@server:manage:manage-logging/manage-logging.adoc#understanding_redaction[in the Server docs]. diff --git a/modules/howtos/pages/concurrent-document-mutations.adoc b/modules/howtos/pages/concurrent-document-mutations.adoc index 525e4315..cbe3eaae 100644 --- a/modules/howtos/pages/concurrent-document-mutations.adoc +++ b/modules/howtos/pages/concurrent-document-mutations.adoc @@ -1,15 +1,15 @@ = Concurrent Document Mutations :page-topic-type: howto -include::partial$attributes.adoc[] :page-aliases: ROOT:concurrent-document-mutations.adoc +include::project-docs:partial$attributes.adoc[] -include::7.0@sdk:shared:partial$cas.adoc[tag=intro] +include::{version-server}@sdk:shared:partial$cas.adoc[tag=intro] -include::7.0@sdk:shared:partial$cas.adoc[tag=demo] +include::{version-server}@sdk:shared:partial$cas.adoc[tag=demo] -include::7.0@sdk:shared:partial$cas.adoc[tag=example] +include::{version-server}@sdk:shared:partial$cas.adoc[tag=example] -include::7.0@sdk:shared:partial$cas.adoc[tag=errors] +include::{version-server}@sdk:shared:partial$cas.adoc[tag=errors] [source,python] ---- @@ -34,11 +34,11 @@ def increment_visit_count(collection, user_id): Sometimes more logic is needed when performing updates, for example, if a property is mutually exclusive with another property; only one or the other can exist, but not both. -include::7.0@sdk:shared:partial$cas.adoc[tag=performance] +include::{version-server}@sdk:shared:partial$cas.adoc[tag=performance] -include::7.0@sdk:shared:partial$cas.adoc[tag=format] +include::{version-server}@sdk:shared:partial$cas.adoc[tag=format] -include::7.0@sdk:shared:partial$cas.adoc[tag=locking] +include::{version-server}@sdk:shared:partial$cas.adoc[tag=locking] [source,python] ---- diff --git a/modules/howtos/pages/distributed-acid-transactions-from-the-sdk.adoc b/modules/howtos/pages/distributed-acid-transactions-from-the-sdk.adoc index 64e82ab3..ce9903a2 100644 --- a/modules/howtos/pages/distributed-acid-transactions-from-the-sdk.adoc +++ b/modules/howtos/pages/distributed-acid-transactions-from-the-sdk.adoc @@ -3,9 +3,11 @@ :navtitle: ACID Transactions :page-topic-type: howto +include::project-docs:partial$attributes.adoc[] + [abstract] {description} Distributed ACID Transactions are not currently available for the Python SDK. -include::7.0@sdk:shared:partial$acid-transactions.adoc[tag=other] +include::{version-server}@sdk:shared:partial$acid-transactions.adoc[tag=other] diff --git a/modules/howtos/pages/json.adoc b/modules/howtos/pages/json.adoc index 3c35fc5c..a1e2a2fe 100644 --- a/modules/howtos/pages/json.adoc +++ b/modules/howtos/pages/json.adoc @@ -1 +1,3 @@ -include::7.0@sdk:pages:partial$json.adoc[] +include::project-docs:partial$attributes.adoc[] + +include::{version-server}@sdk:pages:partial$json.adoc[] diff --git a/modules/howtos/pages/kv-operations.adoc b/modules/howtos/pages/kv-operations.adoc index f6980925..b0e6a20b 100644 --- a/modules/howtos/pages/kv-operations.adoc +++ b/modules/howtos/pages/kv-operations.adoc @@ -4,11 +4,13 @@ :page-topic-type: howto :page-aliases: ROOT:document-operations,ROOT:crud +include::project-docs:partial$attributes.adoc[] + [abstract] {description} Here we cover CRUD operations, document expiration, and optimistic locking with CAS. -The complete code sample used on this page can be downloaded from https://github.com/couchbase/docs-sdk-python/blob/release/3.1/modules/howtos/examples/kv_operations.py[the GitHub repo for the Python docs], from which you can see in context how to authenticate and connect to a Couchbase Cluster, then perform these Collection operations. +The complete code sample used on this page can be downloaded from https://github.com/couchbase/docs-sdk-python/blob/release/3.2/modules/howtos/examples/kv_operations.py[the GitHub repo for the Python docs], from which you can see in context how to authenticate and connect to a Couchbase Cluster, then perform these Collection operations. == Documents @@ -71,8 +73,12 @@ include::howtos:example$kv_operations.py[tag=get_cas_replace] Writes in Couchbase are written to a single node, and from there the Couchbase Server will take care of sending that mutation to any configured replicas. The optional durability parameter, which all mutating operations accept, allows the application to wait until this replication (or persistence) is successful before proceeding. -In Couchbase Server releases before 6.5, Durability was set with two options -- see the xref:2.5@python-sdk::durability.adoc[6.0 Durability documentation] -- covering how many replicas the operation must be propagated to and how many persisted copies of the modified record must exist. -Couchbase Data Platform 6.5 refines these two options, with xref:6.5@server:learn:data/durability.adoc[Durable Writes] -- although they remain essentially the same in use. +In Couchbase Server releases before 6.5, Durability was set with two options -- see the +xref:2.5@python-sdk::durability.adoc[6.0 Durability documentation] -- +covering how many replicas the operation must be propagated to and how many persisted copies of the modified record must exist. +Couchbase Data Platform 6.5 refines these two options, with +xref:{version-server}@server:learn:data/durability.adoc[Durable Writes] -- +although they remain essentially the same in use. The Python SDK exposes both of these forms of Durability. First we will cover the newer durability features available in Couchbase server 6.5 onwards. @@ -198,7 +204,8 @@ NOTE: Increment & Decrement are considered part of the ‘binary’ API, and as == Scoped KV Operations -It is possible to perform scoped key-value operations on named xref:7.0@server:learn:data/scopes-and-collections.adoc[`Collections`] _with Couchbase Server release 7.0_. See the https://docs.couchbase.com/sdk-api/couchbase-python-client/api/couchbase.html#collection-object[API docs] for more information. +It is possible to perform scoped key-value operations on named +xref:{version-server}@server:learn:data/scopes-and-collections.adoc[`Collections`] _with Couchbase Server release 7.0_. See the https://docs.couchbase.com/sdk-api/couchbase-python-client/api/couchbase.html#collection-object[API docs] for more information. Here is an example showing an upsert in the `users` collection, which lives in the `travel-sample.tenant_agent_00` keyspace: diff --git a/modules/howtos/pages/managing-connections.adoc b/modules/howtos/pages/managing-connections.adoc index 452b2cf3..bd655945 100644 --- a/modules/howtos/pages/managing-connections.adoc +++ b/modules/howtos/pages/managing-connections.adoc @@ -4,8 +4,9 @@ :page-topic-type: concept :page-aliases: ROOT:managing-connections,howtos:multi-network,ROOT:connecting,ROOT:connection-advanced +include::project-docs:partial$attributes.adoc[] -Please also refer to the xref:6.5@server:learn:security/authorization-overview.adoc[Server docs]. +Please also refer to the xref:{version-server}@server:learn:security/authorization-overview.adoc[Server docs]. [abstract] {description} @@ -88,7 +89,7 @@ For more detailed documentation please refer to the https://docs.couchbase.com/c == Waiting for Bootstrap Completion -Depending on the environment and network latency, bootstrapping the SDK fully might take a little longer than the default key-value timeout of 2.5 seconds, so you may see timeouts during bootstrap. +Depending on the environment and network latency, bootstrapping the SDK fully might take a little longer than the default key-value timeout of 2.5 seconds, so you may see timeouts during bootstrap. To prevent those early timeouts from happening, you can use the `waitUntilReady` method. If you are working at the _Cluster_ level, then add to the `cluster()` in the xref:#connecting-to-a-cluster[earlier example]: @@ -263,7 +264,7 @@ E.....@.@.............+....Z.'yZ..#........ //// TODO: verify -include::7.0@sdk:shared:partial$dnssrv-pars.adoc[tag=dnssrv] +include::{version-server}@sdk:shared:partial$dnssrv-pars.adoc[tag=dnssrv] DNS SRV bootstrapping is available in the Python SDK from version 2.5. In order to make the SDK actually use the SRV records, you need to enable DNS SRV on the environment and pass in the host name from your records (here `example.com`): @@ -291,7 +292,7 @@ Proceeding with normal bootstrap. ---- //// -include::7.0@sdk:shared:partial$managing-connections.adoc[tag=cloud] +include::{version-server}@sdk:shared:partial$managing-connections.adoc[tag=cloud] == Async APIs diff --git a/modules/howtos/pages/n1ql-queries-with-sdk.adoc b/modules/howtos/pages/n1ql-queries-with-sdk.adoc index 7d29c951..a4fed471 100644 --- a/modules/howtos/pages/n1ql-queries-with-sdk.adoc +++ b/modules/howtos/pages/n1ql-queries-with-sdk.adoc @@ -4,19 +4,22 @@ :page-topic-type: howto :page-aliases: ROOT:n1ql-queries,ROOT:n1ql-queries-with-sdk +include::project-docs:partial$attributes.adoc[] + [abstract] {description} Querying can solve typical programming tasks such as finding a user profile by email address, facebook login, or user ID. Our query service uses N1QL, which will be fairly familiar to anyone who's used any dialect of SQL. xref:#additional-resources[Further resources] for learning about N1QL are listed at the bottom of the page. -Before you get started you may wish to checkout the xref:7.0@server:n1ql:n1ql-language-reference/index.adoc[N1QL intro page], or just dive in with a query against our "travel-sample" data set. +Before you get started you may wish to checkout the +xref:{version-server}@server:n1ql:n1ql-language-reference/index.adoc[N1QL intro page], or just dive in with a query against our "travel-sample" data set. In this case, note that before you can query a bucket, you must define at least one index. You can define a _primary_ index on a bucket. When a primary index is defined you can issue non-covered queries on the bucket as well. Use -xref:7.0@server::tools/cbq-shell.html[cbq], our interactive Query shell. +xref:{version-server}@server::tools/cbq-shell.html[cbq], our interactive Query shell. Open it, and enter the following: [source,n1ql] @@ -238,8 +241,9 @@ NOTE: N1QL is not the only query option in Couchbase. Be sure to check that xref:concept-docs:http-services.adoc[your use case fits your selection of query service]. * For a deeper dive into N1QL from the SDK, refer to our xref:concept-docs:n1ql-query.adoc[N1QL SDK concept doc]. -* The xref:7.0@server:n1ql:n1ql-language-reference/index.adoc[Server doc N1QL intro] introduces a complete guide to the N1QL language, including all of the latest additions. +* The xref:{version-server}@server:n1ql:n1ql-language-reference/index.adoc[Server doc N1QL intro] introduces a complete guide to the N1QL language, including all of the latest additions. * The http://query.pub.couchbase.com/tutorial/#1[N1QL interactive tutorial] is a good introduction to the basics of N1QL use. -* For scaling up queries, be sure to xref:7.0@server:n1ql:n1ql-language-reference/index.adoc[read up on Indexes]. +* For scaling up queries, be sure to +xref:{version-server}@server:n1ql:n1ql-language-reference/index.adoc[read up on Indexes]. * N1QL is for operational queries; for analytical workloads, read more on xref:concept-docs:http-services.adoc#Long-Running-Queries-&-Big-Data[when to choose Analytics Service], our implementation of SQL++. diff --git a/modules/howtos/pages/provisioning-cluster-resources.adoc b/modules/howtos/pages/provisioning-cluster-resources.adoc index e4cb8483..cecb02ff 100644 --- a/modules/howtos/pages/provisioning-cluster-resources.adoc +++ b/modules/howtos/pages/provisioning-cluster-resources.adoc @@ -3,11 +3,13 @@ :navtitle: Provisioning Cluster Resources :page-aliases: ROOT:managing-clusters +include::project-docs:partial$attributes.adoc[] + [abstract] {description} Common use cases are outlined here, more recherché use cases are covered in the https://docs.couchbase.com/sdk-api/couchbase-python-client/[API docs]. -include::7.0@sdk:shared:partial$flush-info-pars.adoc[tag=management-intro] +include::{version-server}@sdk:shared:partial$flush-info-pars.adoc[tag=management-intro] The Python SDK also comes with some convenience functionality for common Couchbase management requests. @@ -36,7 +38,7 @@ include::howtos:example$provisioning_resources_buckets.py[tag=create_bucket_mgr] The `CreateBucketSettings` and `BucketSettings` classes are used for creating and updating buckets, `BucketSettings` is also used for exposing information about existing buckets. -include::7.0@sdk:shared:partial$flush-info-pars.adoc[tag=update-bucket-warning] +include::{version-server}@sdk:shared:partial$flush-info-pars.adoc[tag=update-bucket-warning] Here is the list of parameters available: @@ -79,7 +81,7 @@ include::howtos:example$provisioning_resources_buckets.py[tag=drop_bucket] [#python-flushing] == Flushing Buckets -include::7.0@sdk:shared:partial$flush-info-pars.adoc[tag=flush-intro] +include::{version-server}@sdk:shared:partial$flush-info-pars.adoc[tag=flush-intro] You can flush a bucket in the SDK by using the https://docs.couchbase.com/sdk-api/couchbase-python-client/api/couchbase.html#flushing-clearing-the-bucket[`flush_bucket()` method]. @@ -93,8 +95,6 @@ The `flush_bucket()` operation may fail if the bucket does not have flush enable == Collection Management -[.status]#Developer Preview# - The CollectionManager interface may be used to create and delete scopes and collections from the Couchbase cluster. It is instantiated through the `Bucket.collections()` method. Refer to the https://docs.couchbase.com/sdk-api/couchbase-python-client/api/couchbase.html[API documentation] @@ -131,9 +131,8 @@ include::howtos:example$provisioning_resources_collections.py[tag=drop_scope] ---- Note that the most minimal permissions to create and drop a Scope or Collection is -https://docs.couchbase.com/server/7.0/learn/security/roles.html#manage-collections-in-scope[Scope Admin] -along with -https://docs.couchbase.com/server/7.0/learn/security/roles.html#data-reader[Data Reader]. +xref:server:learn:security/roles.adoc#manage-scopes[Manage Scopes] +along with xref:server:learn:security/roles.adoc#data-reader[Data Reader]. You can create users with the appropriate RBAC programmatically: @@ -170,7 +169,7 @@ For those occasions when you do, please see the relevant API docs: == View Management -include::7.0@sdk:shared:partial$flush-info-pars.adoc[tag=view-management] +include::{version-server}@sdk:shared:partial$flush-info-pars.adoc[tag=view-management] In the SDK, design documents are represented by the `DesignDocument` and `View` classes. All operations on design documents are performed on the `ViewIndexManager` instance: @@ -188,7 +187,7 @@ The following example upserts a design document with two views: include::howtos:example$provisioning_resources_views.py[tag=create_view] ---- -include::7.0@sdk:shared:partial$flush-info-pars.adoc[tag=one-view-update-warning] +include::{version-server}@sdk:shared:partial$flush-info-pars.adoc[tag=one-view-update-warning] Note the use of `DesignDocumentNamespace.DEVELOPMENT`, the other option is `DesignDocumentNamespace.PRODUCTION`. This parameter specifies whether the design document should be created as development, or as production -- with the former running over only a small fraction of the documents. diff --git a/modules/howtos/pages/sdk-authentication.adoc b/modules/howtos/pages/sdk-authentication.adoc index e0fa3eea..b0aaa1af 100644 --- a/modules/howtos/pages/sdk-authentication.adoc +++ b/modules/howtos/pages/sdk-authentication.adoc @@ -4,6 +4,8 @@ :page-edition: Enterprise Edition :page-aliases: ROOT:sdk-authentication-overview +include::project-docs:partial$attributes.adoc[] + [abstract] {description} @@ -23,9 +25,9 @@ from couchbase_core.cluster import PasswordAuthenticator cluster = Cluster('couchbase://localhost', ClusterOptions(PasswordAuthenticator('username', 'password'))) ---- -include::7.0@sdk:shared:partial$auth-overview.adoc[tag=rbac] +include::{version-server}@sdk:shared:partial$auth-overview.adoc[tag=rbac] -include::7.0@sdk:shared:partial$auth-overview.adoc[tag=cert-auth] +include::{version-server}@sdk:shared:partial$auth-overview.adoc[tag=cert-auth] == Authenticating a Python Client by Certificate @@ -35,7 +37,7 @@ include::7.0@sdk:shared:partial$auth-overview.adoc[tag=cert-auth] Certificate authentication in the Python SDK is currently under development. ==== -For sample procedures whereby certificates can be generated and deployed, see xref:6.5@server:manage:manage-security/manage-certificates.adoc[Manage Certificates]. +For sample procedures whereby certificates can be generated and deployed, see xref:{version-server}@server:manage:manage-security/manage-certificates.adoc[Manage Certificates]. The rest of this document assumes that the processes there, or something similar, have been followed. That is, a cluster certificate has been created and installed on the server, a client certificate has been created, and it is stored somewhere accessible to the SDK. The `CertAuthenticator` expects to be given the path to the client certificate and key as well as the path to the certificate trust store. @@ -46,7 +48,7 @@ include::example$cert-auth.py[tag=auth,indent=0] ---- -include::7.0@sdk:shared:partial$auth-overview.adoc[tag=ldap] +include::{version-server}@sdk:shared:partial$auth-overview.adoc[tag=ldap] [source,python] ---- diff --git a/modules/howtos/pages/sdk-user-management-example.adoc b/modules/howtos/pages/sdk-user-management-example.adoc index dd920807..a473acdc 100644 --- a/modules/howtos/pages/sdk-user-management-example.adoc +++ b/modules/howtos/pages/sdk-user-management-example.adoc @@ -24,7 +24,6 @@ include::howtos:example$provisioning_resources_users.py[tag=create_user] ---- .Listing Users -[source,java] [source,python] ---- include::howtos:example$provisioning_resources_users.py[tag=get_all_users] @@ -32,7 +31,6 @@ include::howtos:example$provisioning_resources_users.py[tag=get_all_users] Using a user created in the SDK to access data: -[source,java] [source,python] ---- include::howtos:example$provisioning_resources_users.py[tag=user_operations] diff --git a/modules/howtos/pages/subdocument-operations.adoc b/modules/howtos/pages/subdocument-operations.adoc index 7cb5fa2a..5f30de1b 100644 --- a/modules/howtos/pages/subdocument-operations.adoc +++ b/modules/howtos/pages/subdocument-operations.adoc @@ -6,6 +6,8 @@ :page-aliases: ROOT:sdk-xattr-example.adoc :link-with-underscores: https://docs.couchbase.com/sdk-api/couchbase-python-client/api/couchbase.html?highlight=durability#couchbase.durability.ClientDurability.__init__ +include::project-docs:partial$attributes.adoc[] + [abstract] {description} @@ -322,7 +324,7 @@ include::howtos:example$subdocument_ops.py[tag=obs_durability] ---- In Couchbase Server 6.5 and up, this is built upon with xref:concept-docs:durability-replication-failure-considerations.adoc#durable-writes[Durable Writes], -which uses the concept of xref:6.5@server:learn:data/durability.adoc#majority[majority] to indicate the number of configured Data Service nodes to which commitment is required: +which uses the concept of xref:{version-server}@server:learn:data/durability.adoc#majority[majority] to indicate the number of configured Data Service nodes to which commitment is required: [source,python,indent=0] ---- @@ -401,4 +403,4 @@ a quote or backslash) and then encapsulating it in backticks (`pass:c[`path`]`). NOTE: Currently, paths cannot exceed 1024 characters, and cannot be more than 32 levels deep. -include::7.0@sdk:shared:partial$sdk-xattr-overview.adoc[tag=extended_attributes] +include::{version-server}@sdk:shared:partial$sdk-xattr-overview.adoc[tag=extended_attributes] diff --git a/modules/howtos/pages/troubleshooting-cloud-connections.adoc b/modules/howtos/pages/troubleshooting-cloud-connections.adoc index af2fc3f9..97bbcf07 100644 --- a/modules/howtos/pages/troubleshooting-cloud-connections.adoc +++ b/modules/howtos/pages/troubleshooting-cloud-connections.adoc @@ -1 +1,3 @@ -include::7.0@sdk:pages:partial$troubleshooting-cloud-connections.adoc[] +include::project-docs:partial$attributes.adoc[] + +include::{version-server}@sdk:pages:partial$troubleshooting-cloud-connections.adoc[] diff --git a/modules/howtos/pages/view-queries-with-sdk.adoc b/modules/howtos/pages/view-queries-with-sdk.adoc index 2bc9f89f..12e60419 100644 --- a/modules/howtos/pages/view-queries-with-sdk.adoc +++ b/modules/howtos/pages/view-queries-with-sdk.adoc @@ -4,12 +4,14 @@ :page-topic-type: howto :page-aliases: ROOT:view-queries-with-sdk,ROOT:view-queries +include::project-docs:partial$attributes.adoc[] + [abstract] {description} WARNING: Although still maintained and supported for legacy use, Views date from the earliest days of Couchbase Server development, and as such are rarely the best choice over, say, xref:n1ql-queries-with-sdk.adoc[our Query service] for your application, see xref:concept-docs:data-services.adoc[our guide to choosing the right service]. -include::7.0@sdk:shared:partial$views.adoc[tag=views-intro] +include::{version-server}@sdk:shared:partial$views.adoc[tag=views-intro] == Querying Views diff --git a/modules/project-docs/pages/compatibility.adoc b/modules/project-docs/pages/compatibility.adoc index 38967d13..a8f8d499 100644 --- a/modules/project-docs/pages/compatibility.adoc +++ b/modules/project-docs/pages/compatibility.adoc @@ -4,6 +4,8 @@ Plus notes on Cloud, networks, and AWS Lambda. :navtitle: Compatibility :page-aliases: ROOT:overview,ROOT:compatibility-versions-features,compatibility-versions-features +include::project-docs:partial$attributes.adoc[] + [abstract] {description} @@ -83,7 +85,7 @@ Microsoft Windows 7 / Windows Server 2012 and onwards. [discrete] === Mac OS X -The current and previous two releases of OS X. +The current and previous two releases of OS X. At time of writing (September 2020): 10.13 (_High Sierra_), 10.14 (_Mojave_), and 10.15 (_Catalina_). **** @@ -93,7 +95,7 @@ Although installable or compilable on many other platforms, we cannot provide su == Couchbase New Feature Availability Matrix .Couchbase Server and SDK Supported Version Matrix -[.table-merge-cells] +[.table-merge-cells] [cols="7,7,5,6,5"] |=== | | Server 5.0, 5.1, & 5.5 | Server 6.0 | Server 6.5 & 6.6 | Server 7.0β @@ -101,7 +103,7 @@ Although installable or compilable on many other platforms, we cannot provide su | Enhanced Durability 4+| All SDK versions -| Durable Writes +| Durable Writes 2+| Not Supported 2+| Since 3.0 @@ -116,7 +118,7 @@ Although installable or compilable on many other platforms, we cannot provide su |=== -include::6.5@sdk:shared:partial$network-requirements.adoc[] +include::{version-server}@sdk:shared:partial$network-requirements.adoc[] -include::6.5@sdk:shared:partial$interface-stability-pars.adoc[tag=interface-stability-section] +include::{version-server}@sdk:shared:partial$interface-stability-pars.adoc[tag=interface-stability-section] diff --git a/modules/project-docs/pages/get-involved.adoc b/modules/project-docs/pages/get-involved.adoc index 130ec426..eb385184 100644 --- a/modules/project-docs/pages/get-involved.adoc +++ b/modules/project-docs/pages/get-involved.adoc @@ -1,5 +1,6 @@ = Get Involved :navtitle: Get Involved +include::project-docs:partial$attributes.adoc[] == Contributing @@ -7,4 +8,4 @@ Couchbase welcomes community contributions to the Python SDK. The https://github.com/couchbase/couchbase-python-client[Python SDK source code^] is available on GitHub. Please see the https://github.com/couchbase/couchbase-python-client/blob/master/CONTRIBUTING.md[CONTRIBUTING^] file for further information. -include::7.0@sdk:shared:partial$contrib.adoc[tag=contrib] +include::{version-server}@sdk:shared:partial$contrib.adoc[tag=contrib] diff --git a/modules/project-docs/pages/metadoc-about-these-sdk-docs.adoc b/modules/project-docs/pages/metadoc-about-these-sdk-docs.adoc index 9f239195..10fce653 100644 --- a/modules/project-docs/pages/metadoc-about-these-sdk-docs.adoc +++ b/modules/project-docs/pages/metadoc-about-these-sdk-docs.adoc @@ -1 +1,3 @@ -include::7.0@sdk:pages:partial$about.adoc[] +include::project-docs:partial$attributes.adoc[] + +include::{version-server}@sdk:pages:partial$about.adoc[] diff --git a/modules/project-docs/pages/migrating-sdk-code-to-3.n.adoc b/modules/project-docs/pages/migrating-sdk-code-to-3.n.adoc index c62c644f..b8e035b6 100644 --- a/modules/project-docs/pages/migrating-sdk-code-to-3.n.adoc +++ b/modules/project-docs/pages/migrating-sdk-code-to-3.n.adoc @@ -5,6 +5,8 @@ Collections and Scopes are introduced. :page-topic-type: concept :page-aliases: ROOT:migrate +include::project-docs:partial$attributes.adoc[] + [abstract] {description} The Document class and structure has been completely removed from the API, and the returned value is now `Result`. @@ -12,10 +14,10 @@ Retry behaviour is more proactive, and lazy bootstrapping moves all error handli Individual behaviour changes across services are explained here. -include::7.0@sdk:shared:partial$migration.adoc[tag=intro] +include::{version-server}@sdk:shared:partial$migration.adoc[tag=intro] -include::7.0@sdk:shared:partial$migration.adoc[tag=terms] +include::{version-server}@sdk:shared:partial$migration.adoc[tag=terms] As an example here is a KeyValue document fetch: @@ -38,14 +40,13 @@ Compare this to a N1QL query: query_result = cluster.query("select 1=1", QueryOptions(timeout=timedelta(seconds=3)) ---- -include::7.0@sdk:shared:partial$migration.adoc[tag=terms2] - +include::{version-server}@sdk:shared:partial$migration.adoc[tag=terms2] -include::7.0@sdk:shared:partial$migration.adoc[tag=new] +include::{version-server}@sdk:shared:partial$migration.adoc[tag=new] -include::7.0@sdk:shared:partial$migration.adoc[tag=lang] +include::{version-server}@sdk:shared:partial$migration.adoc[tag=lang] diff --git a/modules/ref/pages/client-settings.adoc b/modules/ref/pages/client-settings.adoc index 5621c1b8..ede4c11f 100644 --- a/modules/ref/pages/client-settings.adoc +++ b/modules/ref/pages/client-settings.adoc @@ -4,6 +4,8 @@ :page-topic-type: reference :page-aliases: ROOT:client-settings.adoc +include::project-docs:partial$attributes.adoc[] + [abstract] {description} @@ -33,7 +35,8 @@ PasswordAuthenticator(username, password), option1=xxx, option2=yyy...) Timeout settings are configured using an instance of `ClusterTimeoutOptions`. .Creating a new timeout config: -[source,java] + +[source,python] ---- timeout_options=ClusterTimeoutOptions(kv_timeout=timedelta(seconds=5), query_timeout=timedelta(seconds=10)) options=ClusterOptions(PasswordAuthenticator('username', 'password'), timeout_options=timeout_options) @@ -613,4 +616,4 @@ You are responsible for stopping it after it is no longer needed. // section on wide area network support -include::7.0@sdk:shared:partial$client-settings-wide-network.adoc[] +include::{version-server}@sdk:shared:partial$client-settings-wide-network.adoc[] diff --git a/modules/ref/pages/error-codes.adoc b/modules/ref/pages/error-codes.adoc index 6819d468..ba6fc89b 100644 --- a/modules/ref/pages/error-codes.adoc +++ b/modules/ref/pages/error-codes.adoc @@ -3,42 +3,44 @@ :nav-title: Error Codes :page-topic-type: ref +include::project-docs:partial$attributes.adoc[] + [abstract] {description} -include::7.0@sdk:shared:partial$error-ref.adoc[tag=intro] +include::{version-server}@sdk:shared:partial$error-ref.adoc[tag=intro] -== Shared Error Definitions +== Shared Error Definitions -include::7.0@sdk:shared:partial$error-ref.adoc[tag=shared] +include::{version-server}@sdk:shared:partial$error-ref.adoc[tag=shared] == KeyValue Error Definitions -include::7.0@sdk:shared:partial$error-ref.adoc[tag=kv] +include::{version-server}@sdk:shared:partial$error-ref.adoc[tag=kv] == Query Error Definitions -include::7.0@sdk:shared:partial$error-ref.adoc[tag=query] +include::{version-server}@sdk:shared:partial$error-ref.adoc[tag=query] == Analytics Error Definitions -include::7.0@sdk:shared:partial$error-ref.adoc[tag=analytics] +include::{version-server}@sdk:shared:partial$error-ref.adoc[tag=analytics] == Search Error Definition -include::7.0@sdk:shared:partial$error-ref.adoc[tag=search] +include::{version-server}@sdk:shared:partial$error-ref.adoc[tag=search] == View Error Definitions -include::7.0@sdk:shared:partial$error-ref.adoc[tag=views] +include::{version-server}@sdk:shared:partial$error-ref.adoc[tag=views] == Management API Error Definitions -include::7.0@sdk:shared:partial$error-ref.adoc[tag=mgmnt] +include::{version-server}@sdk:shared:partial$error-ref.adoc[tag=mgmnt] == Field-Level Encryption Error Definitions -include::7.0@sdk:shared:partial$error-ref.adoc[tag=fle] +include::{version-server}@sdk:shared:partial$error-ref.adoc[tag=fle] //// @@ -52,28 +54,28 @@ This range is reserved for sdk-specific error codes which are not standardized, == Connecting to Cloud -include::7.0@sdk:shared:partial$error-ref.adoc[tag=cloud] +include::{version-server}=@sdk:shared:partial$error-ref.adoc[tag=cloud] .Couldn't look up -[source,terminal] +[source,terminal] ---- ERROR:couchbase.connection:[2302468477383294429] <8676842d-4e8b-4c5b-a44f-e0886f8c0bc1.dp.cloud.couchbase.com:18091> (SOCK=a95ae0d1210d3132) Couldn't look up 8676842d-4e8b-4c5b-a44f-e0886f8c0bc1.dp.cloud.couchbase.com (nodename nor servname provided, or not known) [EAI=8] (L:503) ---- .Failed to establish connection -[source,terminal] +[source,terminal] ---- ERROR:couchbase.connection:[2302468477383294429] <8676842d-4e8b-4c5b-a44f-e0886f8c0bc1.dp.cloud.couchbase.com:18091> (SOCK=a95ae0d1210d3132) Failed to establish connection: LCB_ERR_UNKNOWN_HOST (1049), os errno=0 (L:164) ---- .Connection to REST API failed -[source,terminal] +[source,terminal] ---- ERROR:couchbase.htconfig:[2302468477383294429] Connection to REST API failed with LCB_ERR_UNKNOWN_HOST (1049) (os errno = 0) (L:309) ---- .Provider 'HTTP' failed -[source,terminal] +[source,terminal] ---- INFO:couchbase.confmon:[2302468477383294429] Provider 'HTTP' failed: LCB_ERR_UNKNOWN_HOST (1049) (L:196) ---- diff --git a/modules/ref/pages/glossary.adoc b/modules/ref/pages/glossary.adoc index d6249613..c2e419cc 100644 --- a/modules/ref/pages/glossary.adoc +++ b/modules/ref/pages/glossary.adoc @@ -1 +1,3 @@ -include::7.0@sdk:pages:partial$glossary.adoc[] +include::project-docs:partial$attributes.adoc[] + +include::{version-server}@sdk:pages:partial$glossary.adoc[] diff --git a/modules/ref/pages/travel-app-data-model.adoc b/modules/ref/pages/travel-app-data-model.adoc index 115cf4fc..d990bc75 100644 --- a/modules/ref/pages/travel-app-data-model.adoc +++ b/modules/ref/pages/travel-app-data-model.adoc @@ -1,2 +1,4 @@ -include::7.0@sdk:pages:partial$travel-app-data-model.adoc[] +include::project-docs:partial$attributes.adoc[] + +include::{version-server}@sdk:pages:partial$travel-app-data-model.adoc[]