Skip to content

Commit e4a01f8

Browse files
authored
Merge pull request #255 from osfameron/3.3-release-prep
3.3 release work
2 parents 6395f80 + bc45e11 commit e4a01f8

22 files changed

+186
-106
lines changed

Dockerfile

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
FROM mcr.microsoft.com/dotnet/sdk:6.0
2+
3+
LABEL org.opencontainers.image.authors="Hakim Cassimally <[email protected]>"
4+
5+
RUN apt-get update -y \
6+
&& \
7+
apt-get install -y \
8+
curl vim git
9+
10+
# edit these variables as required
11+
ENV PRE_RELEASE_VERSION 3.2.8-pre
12+
ENV PRE_RELEASE_BUILD r5705
13+
ENV PRE_RELEASE_SOURCE http://sdk.jenkins.couchbase.com/job/dotnet/job/sdk/job/couchbase-net-client-scripted-build-pipeline/lastSuccessfulBuild/artifact/couchbase-net-client-${PRE_RELEASE_VERSION}-${PRE_RELEASE_BUILD}.zip
14+
15+
RUN mkdir -p /app/nuget-sources/
16+
WORKDIR /app/nuget-sources/
17+
RUN curl -O ${PRE_RELEASE_SOURCE}
18+
RUN dotnet nuget add source /app/nuget-sources/
19+
20+
WORKDIR /app
21+
RUN dotnet new console
22+
RUN dotnet add package CouchbaseNetClient -v ${PRE_RELEASE_VERSION}
23+
24+
RUN dotnet tool install -g dotnet-script
25+
RUN export PATH="$PATH:/root/.dotnet/tools"
26+
27+
# RUN git clone https://github.com/couchbase/docs-sdk-dotnet.git
28+
# NB: instead we will mount working directory in docker-compose.yml
29+
30+
ENTRYPOINT ["/bin/bash", "-l", "-c"]
31+
CMD ["/bin/bash"]

docker-compose.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
version: "3.9"
2+
3+
# USAGE: docker-compose run cb-dotnet-sdk bash
4+
5+
services:
6+
cb-dotnet-sdk:
7+
build: .
8+
depends_on:
9+
- db
10+
container_name: cb-dotnet-sdk
11+
entrypoint: [ "/bin/bash", "-l", "-c" ]
12+
volumes:
13+
- .:/app/docs-sdk-dotnet
14+
15+
db:
16+
image: build-docker.couchbase.com:443/couchbase/server-internal:7.1.0-2549
17+
ports:
18+
- "8091-8095:8091-8095"
19+
- "11210:11210"
20+
expose: # expose ports 8091 & 8094 to other containers (mainly for backend)
21+
- "8091"
22+
- "8092"
23+
- "8093"
24+
- "8094"
25+
- "8095"
26+
- "11210"
27+
container_name: couchbase-db

modules/ROOT/nav.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
.Getting Started
55
* xref:hello-world:start-using-sdk.adoc[Start Using the .NET SDK]
6-
// ** xref:hello-world:platform-help.adoc[Platform Introduction]
6+
** xref:hello-world:platform-help.adoc[Platform Introduction]
77
* xref:hello-world:sample-application.adoc[Sample Application]
88
99
.Working with Data

modules/concept-docs/pages/analytics-for-sdk-users.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ For complex and long-running queries, involving large ad hoc join, set, aggregat
2323
2424
== Additional Resources
2525
26-
* Start with our xref:{version-server}@server:analytics:primer-beer.adoc[introductory primer].
26+
* Start with our xref:7.0@server:analytics:primer-beer.adoc[introductory primer].
2727
* Read the practical introduction xref:howtos:analytics-using-sdk.adoc[using analytics from the SDK].

modules/concept-docs/pages/collections.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ include::project-docs:partial$attributes.adoc[]
1010

1111
The Collections feature in Couchbase Server is fully implemented in the 3.2 API version of the Couchbase SDK.
1212

13-
Information on _Collections_ can be found in the xref:{version-server}@server:learn:data:scopes-and-collections.adoc[server docs].
13+
Information on _Collections_ can be found in the xref:7.0@server:learn:data:scopes-and-collections.adoc[server docs].
1414

1515
== Using Collections & Scopes
1616

modules/concept-docs/pages/compression.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ However, stable Snappy support is not yet available in .NET.
1212

1313

1414

15-
Couchbase Server (in the Enterprise Edition) stores documents in compressed form, xref:{version-server}@server:learn:buckets-memory-and-storage/compression.adoc#compression-modes[when it is enabled in the server for a particular bucket], using Snappy Compression.
15+
Couchbase Server (in the Enterprise Edition) stores documents in compressed form, xref:7.0@server:learn:buckets-memory-and-storage/compression.adoc#compression-modes[when it is enabled in the server for a particular bucket], using Snappy Compression.
1616
As the Snappy compression library is not available for .NET, the server will automatically uncompress any compressed documents before sending them to the .NET client.
1717

1818
If compression is set to _active_ on the server, documents will be stored there in compressed form, even though the .NET client has sent them uncompressed, thus saving storage space (but not network bandwidth).

modules/concept-docs/pages/documents.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ await collection.MutateInAsync("customer123", new List<MutateInSpec>
4242
});
4343
----
4444
45-
or xref:{version-server}@server:n1ql:n1ql-language-reference/update.adoc[N1QL UPDATE] to update documents based on specific query criteria:
45+
or xref:7.0@server:n1ql:n1ql-language-reference/update.adoc[N1QL UPDATE] to update documents based on specific query criteria:
4646
4747
[source,sql]
4848
----
@@ -126,5 +126,5 @@ include::{version-server}@sdk:shared:partial$documents.adoc[tag=expiration]
126126
IMPORTANT: If you are using the overloads that take `IDocument`, note that the `IDocument.Expiry` property assumes ms (milli-seconds), and is converted to seconds before being sent to the server.
127127
All other overloads take a `TimeSpan` or an `uint`, and assume an expiry in seconds
128128
A time of zero will set the document to never expire
129-
(a negative number will set expiry to immediate -- creating a xref:{version-server}@server:learn:buckets-memory-and-storage/storage.adoc#tombstones[tombstone]).
129+
(a negative number will set expiry to immediate -- creating a xref:7.0@server:learn:buckets-memory-and-storage/storage.adoc#tombstones[tombstone]).
130130
Values above 0ms but below 1000ms are rounded up to one second before being sent to the server -- _if you are using .NET SDK 3.0.4 or later_.

modules/concept-docs/pages/n1ql-query.adoc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ var result = await cluster.QueryAsync<dynamic>(
2929
);
3030
----
3131

32-
CAUTION: *When running an application using Prepared Statements through the .NET 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 .NET SDK prior to xref:project-docs:sdk-release-notes.adoc#version-3-0-1-13-may-2020[3.0.1], you will need to xref:{version-server}@server:install:upgrade-strategy-for-features.adoc#prepared-statements[restart the app or otherwise work around] a change in the Server's behaviour.
32+
CAUTION: *When running an application using Prepared Statements through the .NET 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 .NET SDK prior to xref:project-docs:sdk-release-notes.adoc#version-3-0-1-13-may-2020[3.0.1], you will need to xref:7.0@server:install:upgrade-strategy-for-features.adoc#prepared-statements[restart the app or otherwise work around] a change in the Server's behaviour.
3333

3434

3535
== Indexes
3636

37-
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.
37+
The Couchbase query service makes use of xref:7.0@server:learn:services-and-indexes/indexes/indexes.adoc[_indexes_] in order to do its work.
3838
Indexes replicate subsets of documents from data nodes over to index nodes,
3939
allowing specific data (for example, specific document properties) to be retrieved quickly,
40-
and to distribute load away from data nodes in xref:{version-server}@server:learn:services-and-indexes/services/services.adoc[MDS] topologies.
40+
and to distribute load away from data nodes in xref:7.0@server:learn:services-and-indexes/services/services.adoc[MDS] topologies.
4141

4242
[IMPORTANT]
4343
In order to make a bucket queryable, it must have at least one index defined.
@@ -82,7 +82,7 @@ Indexes help improve the performance of a query.
8282
When an index includes the actual values of all the fields specified in the query,
8383
the index _covers_ the query, and eliminates the need to fetch the actual values from the Data Service.
8484
An index, in this case, is called a _covering index_, and the query is called a _covered_ query.
85-
For more information, see xref:{version-server}@server:n1ql:n1ql-language-reference/covering-indexes.adoc[Covering Indexes].
85+
For more information, see xref:7.0@server:n1ql:n1ql-language-reference/covering-indexes.adoc[Covering Indexes].
8686

8787
You can also create and define indexes in the SDK using:
8888

@@ -131,7 +131,7 @@ include::{version-server}@sdk:shared:partial$n1ql-queries.adoc[tag=index-consist
131131

132132
The following options are available:
133133

134-
include::{version-server}@server:learn:page$services-and-indexes/indexes/index-replication.adoc[tag=scan_consistency]
134+
include::7.0@server:learn:page$services-and-indexes/indexes/index-replication.adoc[tag=scan_consistency]
135135
////
136136
* `not_bounded`: Executes the query immediately, without requiring any consistency for the query.
137137
If index-maintenance is running behind, out-of-date results may be returned.

modules/devguide/examples/dotnet/Cloud.cs

Lines changed: 0 additions & 63 deletions
This file was deleted.
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
using System;
2+
// #tag::using[]
3+
using System.Threading.Tasks;
4+
using Couchbase;
5+
// #end::using[]
6+
7+
await new CloudExample().Main();
8+
9+
class CloudExample
10+
{
11+
public async Task Main()
12+
{
13+
// #tag::connect[]
14+
var cluster = await Cluster.ConnectAsync(
15+
// Update these credentials for your Capella instance!
16+
"couchbases://cb.njg8j7mwqnvwjqah.cloud.couchbase.com",
17+
new ClusterOptions
18+
{
19+
UserName = "username",
20+
Password = "Password!123",
21+
KvTimeout = TimeSpan.FromSeconds(10)
22+
});
23+
// #end::connect[]
24+
25+
// #tag::bucket[]
26+
// get a bucket reference
27+
var bucket = await cluster.BucketAsync("travel-sample");
28+
// #end::bucket[]
29+
30+
// #tag::collection[]
31+
// get a user-defined collection reference
32+
var scope = await bucket.ScopeAsync("tenant_agent_00");
33+
var collection = await scope.CollectionAsync("users");
34+
// #end::collection[]
35+
36+
// #tag::upsert-get[]
37+
// Upsert Document
38+
var upsertResult = await collection.UpsertAsync("my-document-key", new { Name = "Ted", Age = 31 });
39+
var getResult = await collection.GetAsync("my-document-key");
40+
41+
Console.WriteLine(getResult.ContentAs<dynamic>());
42+
// #end::upsert-get[]
43+
44+
// tag::n1ql-query[]
45+
// Call the QueryAsync() function on the cluster object and store the result.
46+
var queryResult = await cluster.QueryAsync<dynamic>("select \"Hello World\" as greeting");
47+
48+
// Iterate over the rows to access result data and print to the terminal.
49+
await foreach (var row in queryResult) {
50+
Console.WriteLine(row);
51+
}
52+
// end::n1ql-query[]
53+
}
54+
}

0 commit comments

Comments
 (0)