Skip to content

Commit a5cdf2a

Browse files
DOC-9973 4.1.0 release and NUX tweaks
1 parent cc38d6f commit a5cdf2a

File tree

4 files changed

+168
-110
lines changed

4 files changed

+168
-110
lines changed

modules/hello-world/pages/overview.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
= Couchbase Node.js SDK 4.0
1+
= Couchbase Node.js SDK 4.1
22
:page-type: landing-page
33
:page-layout: landing-page-top-level-sdk
44
:page-role: tiles
@@ -35,7 +35,7 @@ queryResult.rows.forEach((row)=>{
3535
[.column]
3636
====== {empty}
3737

38-
== Couchbase Node.js SDK 4.0
38+
== Couchbase Node.js SDK 4.1
3939

4040
++++
4141
<div class="card-row three-column-row">

modules/hello-world/pages/start-using-sdk.adoc

Lines changed: 56 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -2,104 +2,83 @@
22
:description: Installing the Couchbase Node.js SDK & a Hello World program.
33
:page-aliases: ROOT:getting-started,ROOT:start-using,ROOT:hello-couchbase,ROOT:start-using-sdk
44
:navtitle: Start Using the SDK
5+
:page-toclevels: 2
6+
:description: The Couchbase Node.js SDK enables you to interact with a Couchbase Server or Capella cluster from the Node.js runtime, using Typescript or JavaScript.
7+
58

69
[abstract]
7-
The Couchbase Node.js SDK enables you to interact with a Couchbase Server cluster from the link:https://nodejs.org/[Node.js runtime].
10+
{description}
811

912
The Couchbase SDK API 3 (implemented by Node.js SDK 3._x_ and 4._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).
1013

11-
SDK API 3 also brings in link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises[promises], to reduce the complexity of asynchronous javascript in client applications, as well as extending the management APIs and bringing better debugging and logging options.
12-
1314
Node.js SDK 4._x_ implements the same SDK API 3 bindings, but the internals are completely rewritten --
1415
using the Couchbase++ library rather than libcouchbase -- to allow upcoming new features such as transactions, and fix some long-standing bugs.
1516
Please note any xref:project-docs:migrating-sdk-code-to-3.n.adoc#sdk4-specifics[caveats] in the migration guide.
1617

17-
// tag::prep[]
18-
// end::prep[]
1918

20-
// tag::install[]
19+
== Hello Couchbase
2120

22-
== Creating a New Node.js Project
23-
// This section is optional
21+
On this page we show you how to quickly get up and running -- installing the Couchbase Node.js SDK, and trying out the Hello World code example against Couchbase Capella, or against a local Couchbase cluster.
2422

25-
Creating a Node.js project is as easy as making a directory and initializing it with npm. The next two commands will do that for us. Open up a terminal and run the following command:
23+
We will go through the code sample step by step, but for those in a hurry to see it, here it is:
2624

27-
[source,console]
25+
[{tabs}]
26+
====
27+
Couchbase Capella Sample::
28+
+
29+
--
30+
If you are connecting to https://docs.couchbase.com/cloud/index.html[Couchbase Capella], be sure to get the correct endpoint as well as user, password, and `couchbasecloudbucket` -- and see the <<cloud-connections, Cloud section>>, below.
31+
32+
[source,javascript]
2833
----
29-
$ mkdir node-couchbase-project && cd $_
34+
include::devguide:example$nodejs/cloud.js[tags=**]
3035
----
36+
--
3137
32-
The command above will make our directory and change our current working directory.
33-
34-
[source,console]
38+
Local Server with TS::
39+
+
40+
--
41+
[source,typescript,indent=0]
3542
----
36-
$ npm init -y
43+
include::../examples/start-using.ts[tags=**]
3744
----
45+
--
3846
39-
If a directory does not already have a `package.json` at its root, this means it is not initialized. The command above will accomplish this.
40-
41-
Note: We have used the `-y` flag to take the initialization defaults. To change any of these defaults, just open the `package.json` and manually make any changes.
42-
43-
[source,json,indent=0]
47+
Local Server with JS::
48+
+
49+
--
50+
[source.try-it,nodejs,indent=0]
4451
----
45-
include::../examples/example-package.json[]
52+
include::../examples/start-using.js[tags=**]
4653
----
54+
--
55+
====
4756

48-
== Installing the SDK
4957

50-
The Couchbase Node.js Client will run on any https://nodejs.org/en/download/[supported LTS version of Node.js].
58+
== Quick Installation
5159

5260
[source,console]
5361
----
5462
$ npm install couchbase --save
5563
----
5664

57-
Note: This will download the latest Couchbase Node.js SDK, and add a dependency to your `package.json`.
58-
65+
This will download the latest Couchbase Node.js SDK, and add a dependency to your `package.json`.
5966

60-
// MacOS
61-
// https://issues.couchbase.com/browse/DOC-6367
62-
// Catalina & node-gyp
63-
////
64-
npm install:
65-
66-
gyp: No Xcode or CLT version detected!
67-
68-
https://github.com/nodejs/node-gyp/blob/master/macOS_Catalina.md#Solutions
69-
////
70-
71-
72-
// end::install[]
73-
74-
Information on new features, fixes, known issues, as well as information on how to install older release versions is in the xref:project-docs:sdk-release-notes.adoc[release notes].
67+
Information on new features, fixes, known issues, as well as information on how to install older release versions is in the xref:project-docs:sdk-release-notes.adoc[release notes], and a fuller installation guide can be found xref:project-docs:sdk-full-installation.adoc[here].
7568

7669
=== TypeScript Support
7770

78-
NOTE: Follow this section only if you intend to use `TypeScript` instead of `JavaScript`.
79-
80-
Since release 3.2, the Node.js SDK has added full support for the link:https://www.typescriptlang.org/[TypeScript] programming language.
71+
If you intend to use `TypeScript` instead of `JavaScript`, then also do the following:
8172

8273
[source,console]
8374
----
8475
$ npm install -g typescript ts-node
8576
----
8677

87-
This will install TypeScript globally on your machine and allow you to run commands with the `tsc` cli. You will have noticed that we also install link:https://typestrong.org/ts-node/[ts-node] which is a handy execution utility that will help us run the example later on.
88-
89-
Before we can get started, run `tsc --init` in the `node-couchbase-project` directory
90-
to generate a `tsconfig.json` file. This will set you up with some initial configurations, which should suffice for our purposes.
91-
92-
Should you wish to make changes in future you can simply edit the file:
93-
94-
[source,json,indent=0]
95-
----
96-
include::../examples/example-tsconfig.json[]
97-
----
98-
99-
Note that the example above does not include the generated comments for readability.
78+
Further details can be found in the xref:project-docs:sdk-full-installation.adoc[full installation page].
10079

10180

102-
== Hello Couchbase
81+
== Step by Step
10382

10483
At this point we want to transition from the terminal to your code editor of choice and point to the directory we have just created named `node-couchbase-project`.
10584

@@ -392,54 +371,20 @@ GetResult {
392371
----
393372

394373

395-
== Full Example
396-
397-
If you want to copy and paste to run the full example, here it is:
398-
399-
[{tabs}]
400-
====
401-
JS::
402-
+
403-
--
404-
[source.try-it,nodejs,indent=0]
405-
----
406-
include::../examples/start-using.js[tags=**]
407-
----
408-
--
409-
410-
TS::
411-
+
412-
--
413-
[source,typescript,indent=0]
414-
----
415-
include::../examples/start-using.ts[tags=**]
416-
----
417-
--
418-
419-
Couchbase Capella Sample::
420-
+
421-
--
422-
If you are connecting to https://docs.couchbase.com/cloud/index.html[Couchbase Capella], be sure to get the correct endpoint as well as user, password, and `couchbasecloudbucket` -- and see the <<cloud-connections, Cloud section>>, below.
423-
424-
[source,javascript]
425-
----
426-
include::devguide:example$nodejs/cloud.js[tags=**]
427-
----
428-
--
429-
====
430-
431-
432-
== Cloud Connections
433374

434-
If you are not working from the same _Availability Zone_ as your Capella instance, refer to the following:
435375

436-
* Notes on xref:ref:client-settings.adoc#constrained-network-environments[Constrained Network Environments],
437-
* xref:project-docs:compatibility.adoc#network-requirements[Network Requirements],
438-
* If you have a consumer-grade router which has problems with DNS-SRV records review our xref:howtos:troubleshooting-cloud-connections.adoc#troubleshooting-host-not-found[Troubleshooting Guide].
376+
== Next Steps
439377

378+
Now you're up and running, try one of the following:
440379

380+
* Our xref:hello-world:sample-application.adoc[Travel Sample Application] demonstrates all the basics you need to know;
381+
* Explore xref:howtos:kv-operations.adoc[Key Value Operations] against a document database;
382+
* Or xref:howtos:n1ql-queries-with-sdk.adoc[Query] with our SQL-based N1QL language;
383+
// * Try longer-running queries with our xref:howtos:analytics-using-sdk.adoc[Analytics Service];
384+
// * A xref:howtos:full-text-searching-with-sdk.adoc[Full Text Search];
385+
* Or read up on xref:concept-docs:data-services.adoc[which service fits your use case].
441386

442-
== Additional Resources
387+
=== Additional Resources
443388

444389
The API reference is generated for each release and the latest can be found https://docs.couchbase.com/sdk-api/couchbase-node-client/index.html[here].
445390

@@ -450,5 +395,14 @@ The xref:project-docs:migrating-sdk-code-to-3.n.adoc[Migrating from SDK API 2 to
450395
Couchbase welcomes community contributions to the Node.js SDK.
451396
The Node.js SDK source code is available on https://github.com/couchbase/couchnode[GitHub].
452397

453-
https://ottomanjs.com/[Ottoman] is an ODM built for Couchbase and Node.js.
454-
Ottoman's goal is to provide a better development experience while using Couchbase, bringing to developers a reliable tool to build systems that are easy to design, maintain, and scale.
398+
// https://ottomanjs.com/[Ottoman] is an ODM built for Couchbase and Node.js.
399+
// Ottoman's goal is to provide a better development experience while using Couchbase, bringing to developers a reliable tool to build systems that are easy to design, maintain, and scale.
400+
401+
=== Troubleshooting
402+
403+
* Couchbase Server is designed to work in the same WAN or availability zone as the client application.
404+
If you're running the SDK on your laptop against a Capella cluster, see further information on:
405+
** Notes on xref:ref:client-settings.adoc#constrained-network-environments[Constrained Network Environments].
406+
** xref:project-docs:compatibility.adoc#network-requirements[Network Requirements].
407+
** If you have a consumer-grade router which has problems with DNS-SRV records review our xref:howtos:troubleshooting-cloud-connections.adoc#troubleshooting-host-not-found[Troubleshooting Guide].
408+
* Our https://forums.couchbase.com/c/node-js-sdk/12[community forum] is a great source of help.
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
= Couchbase Node.js SDK Installation
2+
:description: Installation instructions for the Couchbase Node.js Client.
3+
:navtitle: Full Installation
4+
:page-partial:
5+
:page-topic-type: project-doc
6+
:page-toclevels: 2
7+
8+
[abstract]
9+
{description}
10+
11+
12+
The Couchbase Node.js Client will run on any https://github.com/nodejs/Release[supported LTS version of Node.js] -- currently, 12.x, 14.x, 16.x, and 18.x.
13+
14+
== Installing the SDK
15+
16+
The Couchbase Node.js Client will run on any https://nodejs.org/en/download/[supported LTS version of Node.js].
17+
18+
[source,console]
19+
----
20+
$ npm install couchbase --save
21+
----
22+
23+
Note: This will download the latest Couchbase Node.js SDK, and add a dependency to your `package.json`.
24+
25+
26+
// MacOS
27+
// https://issues.couchbase.com/browse/DOC-6367
28+
// Catalina & node-gyp
29+
////
30+
npm install:
31+
32+
gyp: No Xcode or CLT version detected!
33+
34+
https://github.com/nodejs/node-gyp/blob/master/macOS_Catalina.md#Solutions
35+
////
36+
37+
38+
// end::install[]
39+
40+
Information on new features, fixes, known issues, as well as information on how to install older release versions is in the xref:project-docs:sdk-release-notes.adoc[release notes].
41+
42+
=== TypeScript Support
43+
44+
NOTE: Follow this section only if you intend to use `TypeScript` instead of `JavaScript`.
45+
46+
Since release 3.2, the Node.js SDK has added full support for the link:https://www.typescriptlang.org/[TypeScript] programming language.
47+
48+
[source,console]
49+
----
50+
$ npm install -g typescript ts-node
51+
----
52+
53+
This will install TypeScript globally on your machine and allow you to run commands with the `tsc` cli. You will have noticed that we also install link:https://typestrong.org/ts-node/[ts-node] which is a handy execution utility that will help us run the example later on.
54+
55+
Before we can get started, run `tsc --init` in the `node-couchbase-project` directory
56+
to generate a `tsconfig.json` file. This will set you up with some initial configurations, which should suffice for our purposes.
57+
58+
Should you wish to make changes in future you can simply edit the file:
59+
60+
[source,json,indent=0]
61+
----
62+
include::../examples/example-tsconfig.json[]
63+
----
64+
65+
Note that the example above does not include the generated comments for readability.
66+

modules/project-docs/pages/sdk-release-notes.adoc

Lines changed: 44 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,9 @@ include::project-docs:partial$attributes.adoc[]
1212

1313
These pages cover the 4._x_ and 3._x_ versions of the Couchbase Node.js SDK.
1414

15-
For release notes, download links, and installation methods for 2.6 and earlier releases of the Couchbase Node.js Client, please see the xref:2.6@nodejs-sdk::sdk-release-notes.adoc[2.x Node.js Release Notes & Download Archive].
15+
For release notes, download links, and installation methods for 2.6 and earlier releases of the Couchbase Node.js Client, please see the https://docs-archive.couchbase.com/nodejs-sdk/2.6/sdk-release-notes.html[2.x Node.js Release Notes & Download Archive].
1616

17-
The Couchbase Node.js Client will run on any https://github.com/nodejs/Release[supported LTS version of Node.js] -- currently, 12.x, 14.x, and 16.x.
18-
19-
// include::hello-world:start-using-sdk.adoc[tag=prep]
20-
21-
// include::hello-world:start-using-sdk.adoc[tag=install]
17+
The Couchbase Node.js Client will run on any https://github.com/nodejs/Release[supported LTS version of Node.js].
2218

2319
To install an older version, specify the version directly with npm.
2420
For example, to install version 3.2.4:
@@ -29,6 +25,48 @@ $ npm install couchbase@3.2.4
2925
----
3026

3127

28+
== Version 4.1.0 (28 April 2022)
29+
30+
Version 4.1.0 is the next minor release of the fourth generation Node.js SDK, bringing a number of improvements.
31+
32+
[source,console]
33+
----
34+
$ npm install couchbase@4.1.0
35+
----
36+
37+
http://docs.couchbase.com/sdk-api/couchbase-node-client-4.1.0/[API Reference]
38+
39+
=== New Features
40+
41+
* * http://issues.couchbase.com/browse/JSCBC-956[JSCBC-956]: Added ability to manage collection query indexes.
42+
43+
=== Fixed Issues
44+
45+
* http://issues.couchbase.com/browse/JSCBC-1045[JSCBC-1045]:
46+
Added missing mutate_in path flag values from couchbase++.
47+
* http://issues.couchbase.com/browse/JSCBC-1044[JSCBC-1044]:
48+
Fixed issue with double-encoding of search queries.
49+
* http://issues.couchbase.com/browse/JSCBC-1067[JSCBC-1067]:
50+
Fixed issue with query parameters being double-encoded.
51+
* http://issues.couchbase.com/browse/JSCBC-1058[JSCBC-1058]:
52+
Switched to using auto-generated bindings.
53+
Fixed issue with durable operations not using user timeouts.
54+
Fixed issue with creating indexes with no conditions.
55+
Mark all new SDK 3.4 APIs as committed.
56+
Updated to latest dependencies.
57+
Various minor fixes.
58+
59+
=== Known Issues
60+
61+
* http://issues.couchbase.com/browse/JSCBC-1011[JSCBC-1011]:
62+
Core IO logging is not forwarded through to Node.js.
63+
* http://issues.couchbase.com/browse/JSCBC-1040[JSCBC-1040]:
64+
Distributed tracing is not yet supported.
65+
* http://issues.couchbase.com/browse/JSCBC-1041[JSCBC-1041]:
66+
Replica reads are not yet supported.
67+
* http://issues.couchbase.com/browse/JSCBC-1042[JSCBC-1042]:
68+
Legacy durability operations are not yet supported.
69+
3270

3371
== Version 4.0.0 (18 February 2022)
3472

0 commit comments

Comments
 (0)