-
Notifications
You must be signed in to change notification settings - Fork 26
DOC-13726 add ide section #282
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: temp/4.6
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -139,11 +139,11 @@ If you intend to use `TypeScript` instead of `JavaScript`, then also do the foll | |
| $ npm install -g typescript ts-node | ||
| ---- | ||
|
|
||
| // === IDE Plugins | ||
| // | ||
| // To make development easier, Couchbase plugins are available for VSCode and the IntelliJ family of IDEs and editors. | ||
| // For links and more information on these and other integrations across the {name_platform} ecosystem, | ||
| // check out the xref:project-docs:third-party-integrations.adoc[] page. | ||
| === IDE Plugins | ||
|
|
||
| To make development easier, Couchbase plugins are available for VSCode and the IntelliJ family of IDEs and editors. | ||
| For links and more information about these and other integrations across the {name_platform} ecosystem, | ||
| check out the xref:project-docs:third-party-integrations.adoc[] page. | ||
|
|
||
| === Grab the Code | ||
|
|
||
|
|
@@ -178,11 +178,11 @@ Otherwise, read on as we introduce the CRUD API and connection to Capella or sel | |
|
|
||
| TIP: There's a *View* link to the complete sample code on GitHub above each of the snippets on these SDK pages, and a *Copy* icon to grab just the snippet shown. | ||
|
|
||
| NOTE: The code samples on this page use ESModules, but the Node.js SDK is fully compatible with CommonJS as well. Simply adjust the import syntax as needed. | ||
| NOTE: The code samples on this page use ESModules, but the Node.js SDK is fully compatible with CommonJS as well. Specify the import syntax as needed. | ||
|
|
||
| == Connect to your Database | ||
|
|
||
| Connect to your Couchbase Capella operational cluster (or your local Couchbase Cluster, if you are trying out self-managed Couchbase). | ||
| Connect to your Couchbase Capella operational cluster (or your local Couchbase Cluster, if you're trying out self-managed Couchbase). | ||
|
|
||
| [tabs] | ||
| ==== | ||
|
|
@@ -194,7 +194,7 @@ Couchbase Capella (JavaScript):: | |
| include::devguide:example$nodejs/capella_connection_crud.js[tag=connect,indent=0] | ||
| ---- | ||
|
|
||
| Note, the client certificate for connecting to a Capella cluster is included in the SDK installation. | ||
| NOTE: SDK installation includes the client certificate for connecting to a Capella cluster. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This could be interpreted as saying that the cert is brought in as part of the installation process, |
||
| -- | ||
|
|
||
| Couchbase Capella (Typescript):: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Presuming you ran Vale - did it show up all of the places where Javascript should be JavaScript,
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No it didnt show. I will search for it and change it everywhere. |
||
|
|
@@ -205,7 +205,7 @@ Couchbase Capella (Typescript):: | |
| include::devguide:example$nodejs/capella_connection_crud.ts[tag=connect,indent=0] | ||
| ---- | ||
|
|
||
| Note, the client certificate for connecting to a Capella cluster is included in the SDK installation. | ||
| NOTE: SDK installation includes the client certificate for connecting to a Capella cluster. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See above. |
||
| -- | ||
|
|
||
| Self-Managed Couchbase Server (Javascript):: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Javascript --> JavaScript |
||
|
|
@@ -228,12 +228,12 @@ include::devguide:example$nodejs/self-managed-connection-crud.ts[tag=connect,ind | |
| ==== | ||
|
|
||
|
|
||
| The `ClientOptions` are covered more fully on the xref:ref:client-settings.adoc[Client Settings] page. | ||
| The xref:ref:client-settings.adoc[Client Settings] page covers `ClientOptions` in detail. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Before proposing a change, it's sometimes a good idea to check that the sentence is in fact true. Note that Maybe consider a change like: |
||
|
|
||
| For a deeper look at connection options, read xref:howtos:managing-connections.adoc[]. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove this line - another disappointing journey. |
||
|
|
||
| TIP: The connection code for getting started uses the Administrator password that you were given during set up. | ||
| In any production app you should create a role restricted to the permissions needed for your app | ||
| TIP: The connection code for getting started uses the Administrator password and credentials provided during set up. | ||
| In any production app, create a role restricted to the permissions needed for your app | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removing "you should" leaves the sentence awkwardly disjointed. |
||
| // -- | ||
| // more on this in xref:concept-docs:best-practices.adoc#roles-and-rbac[the Security documentation]. | ||
|
|
||
|
|
@@ -263,8 +263,8 @@ include::devguide:example$nodejs/capella_connection_crud.ts[tag=bucket,indent=0] | |
|
|
||
| ==== | ||
|
|
||
| *Collections* allow documents to be grouped by purpose or theme, according to a specified *scope* -- see data modeling, <<data-modeling,below>>. | ||
| Here we will use the `airport` collection within the `inventory` scope from `travel-sample` bucket as an example. | ||
| *Collections* allow documents to be grouped by purpose or theme, according to a specified *scope*. For more information, see data modeling, <<data-modeling,below>>. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does one tiny clause need a new sentence? |
||
| The example here shows the `airport` collection, within the `inventory` scope, from the `travel-sample` bucket. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Whilst technically correct that all of the snippets are part of a single sample, I think most readers will see separate snippets as each being an example. The examples here use the |
||
|
|
||
| [tabs] | ||
| ==== | ||
|
|
@@ -292,11 +292,11 @@ include::devguide:example$nodejs/capella_connection_crud.ts[tag=collection,inden | |
| == Create, Read, Update, Delete | ||
|
|
||
| Couchbase documents are organized into buckets, scopes, and collections. | ||
| https://en.wikipedia.org/wiki/CRUD[CRUD operations^] -- Create, Read, Update, Delete -- can be performed upon documents in a collection. | ||
| https://en.wikipedia.org/wiki/CRUD[CRUD operations^] -- Create, Read, Update, Delete actions can be performed upon documents in a collection. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. CRUD expansion is a subclause - why not leave both em dashes? |
||
|
|
||
| === JSON | ||
|
|
||
| We'll create a regular javascript object to start with: | ||
| Create a regular javascript object to start with: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you explain the aim of this change? Then back up and look at what it is we're telling the reader. May I suggest: |
||
|
|
||
| [tabs] | ||
| ==== | ||
|
|
@@ -323,12 +323,12 @@ include::devguide:example$nodejs/capella_connection_crud.ts[tag=json,indent=0] | |
|
|
||
| === Insert (Create) and Upsert | ||
|
|
||
| `insert` and `upsert` will both create a new document. | ||
| The difference between the two is that if a document with that key already exists, the `insert` operation will fail, | ||
| `insert` and `upsert` both create a new document. | ||
| The difference is, if a document with a key exists already, the `insert` operation fails | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. already exists sounds more natural than exists already, but it's a minor point of style, and certainly arguable. |
||
| // throwing `DocumentExistsException` -- | ||
| while the `upsert` operation will succeed, replacing the content. | ||
| and the `upsert` operation replaces the content and succeeds. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The key here is it succeeds, |
||
|
|
||
| We need to provide a unique ID as the key, and we'll use a UUID here: | ||
| Provide a unique ID as the key, and use a UUID here: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you reread this sentence, and come up with an alternative suggestion? What are the key things we're telling the developer? |
||
|
|
||
| .Creating a new document | ||
| [tabs] | ||
|
|
@@ -356,7 +356,8 @@ include::devguide:example$nodejs/capella_connection_crud.ts[tag=upsert,indent=0] | |
|
|
||
| === Get (Read) | ||
|
|
||
| The `get` method reads a document from a collection. If the collection does not have a document with this ID, the `get` method also throws `DocumentNotFoundError`. | ||
| The `get` method reads a document from a collection. | ||
| The `get` method also throws `DocumentNotFoundError`, if the collection does not have a document with this ID. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm interested to know about why this is swapped around - the also now makes less stylistic sense at the beginning of the sentence. |
||
|
|
||
| [tabs] | ||
| ==== | ||
|
|
@@ -407,8 +408,8 @@ include::devguide:example$nodejs/capella_connection_crud.ts[tag=replace,indent=0 | |
|
|
||
| ==== | ||
|
|
||
| CAUTION: When you replace a document, it's usually good practice to use xref:howtos:concurrent-document-mutations.adoc[optimistic locking]. | ||
| Otherwise, changes might get lost if two people change the same document at the same time. | ||
| CAUTION: Always practice to use xref:howtos:concurrent-document-mutations.adoc[optimistic locking] when you replace a document. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We want to steer developers to best practices, |
||
| Else, changes might get lost if 2 people change the same document at the same time. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this an American English thing? Otherwise feels more natural here. |
||
|
|
||
| === Remove (Delete) | ||
|
|
||
|
|
@@ -440,23 +441,22 @@ include::devguide:example$nodejs/capella_connection_crud.ts[tag=remove,indent=0] | |
|
|
||
| == Data Modeling | ||
|
|
||
| Documents are organized into collections -- collections of documents that belong together. | ||
| You get to decide what it means to "belong." | ||
| Developers usually put documents of the same type in the same collection. | ||
| Documents that belong together are organized into collections. | ||
| You decide what it means to "belong." | ||
| Developers group documents of the same type in a collection. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I know that the style guide gives usually as a weasel word, Please have a think of another way we can carry the meaning. |
||
|
|
||
| For example, imagine you have two types of documents: customers and invoices. | ||
| You could put the customer documents in a collection called `customers`, and the invoice documents in a collection called `invoices`. | ||
| For example, there are two types of documents: customers and invoices. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. perhaps "there are" carries an implication that this applies universally - could we try: |
||
| You can organize the customer documents in a collection named `customers` and the invoice documents in a collection named `invoices`. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just curious - why the change from called to named? |
||
|
|
||
| Each document belongs to exactly one collection. | ||
| A document's ID is unique _within_ the collection. | ||
| Every document belongs to a collection. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Doesn't this remove the precision of the sentence?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. True may be! Should we go back to the original ? |
||
| A document's ID is unique `within` the collection. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Whilst the style guide strongly dislikes italic emphasis,
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see |
||
|
|
||
| Different scopes can hold collections with different names. | ||
| There is no relationship between collections in different scopes. | ||
| Each collection belongs to just one scope and | ||
| a collection's name is unique within the scope. | ||
| There's no relationship between collections in different scopes. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sometimes the there is to there's change can dull the necessary emphasis that gives meaning. |
||
| Each collection belongs to 1 scope and a collection's name is unique within the scope. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Likewise one --> 1 |
||
|
|
||
|
|
||
| More details can be found on the xref:concept-docs:data-model.adoc[Data Model page]. | ||
| You can find more details on the xref:concept-docs:data-model.adoc[Data Model page]. | ||
| // The xref:student-record-developer-tutorial.adoc[Student Records Tutorial] gives an introduction to data modeling in a document database alongside using the {name-sdk}. | ||
|
|
||
|
|
||
|
|
@@ -491,18 +491,19 @@ both | |
|
|
||
| Now you're up and running, try one of the following: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Everything below here is in a commented out section. How about uncommenting the Next Steps above here instead? |
||
|
|
||
| * Our xref:hello-world:sample-application.adoc[Travel Sample Application] demonstrates all the basics you need to know; | ||
| * Explore xref:howtos:kv-operations.adoc[Key Value Operations] (CRUD) against a document database; | ||
| * Or xref:howtos:sqlpp-queries-with-sdk.adoc[Query] with our SQL-based {sqlpp} query language; | ||
| * Try longer-running queries with our xref:howtos:analytics-using-sdk.adoc[Analytics Service]; | ||
| * A xref:howtos:full-text-searching-with-sdk.adoc[Full Text Search]; | ||
| * Our xref:hello-world:sample-application.adoc[Travel Sample Application] demonstrates all the basics you need to know. | ||
| * Explore xref:howtos:kv-operations.adoc[Key Value Operations] (CRUD) against a document database. | ||
| * Or xref:howtos:sqlpp-queries-with-sdk.adoc[Query] with our SQL-based {sqlpp} query language. | ||
| * Try longer-running queries with our xref:howtos:analytics-using-sdk.adoc[Analytics Service]. | ||
| * A xref:howtos:full-text-searching-with-sdk.adoc[Full Text Search]. | ||
| * Or read up on xref:concept-docs:data-services.adoc[which service fits your use case]. | ||
|
|
||
| === Additional Resources | ||
|
|
||
| The Scala SDK includes three APIs. | ||
| The examples above show the simple blocking API, for simplicity, but you can also perform all operations in an async style using Scala `Future`, and a reactive style using Project Reactor `SMono` and `SFlux`. | ||
| Please see xref:howtos:concurrent-async-apis.adoc[Choosing an API] for more details. | ||
| The examples above show the simple blocking API. | ||
| You can also perform all the operations in an async style using Scala `Future` and a reactive style using Project Reactor `SMono` and `SFlux`. | ||
| For more information, see xref:howtos:concurrent-async-apis.adoc[Choosing an API]. | ||
|
|
||
| The API reference is generated for each release and the latest can be found https://docs.couchbase.com/sdk-api/couchbase-scala-client/com/couchbase/client/scala/index.html[here]. | ||
|
|
||
|
|
@@ -515,6 +516,6 @@ The SDK source code is available on https://github.com/couchbase/couchbase-jvm-c | |
| If you're running the SDK on your laptop against a Capella cluster, see further information on: | ||
| ** Notes on xref:ref:client-settings.adoc#constrained-network-environments[Constrained Network Environments]. | ||
| ** xref:project-docs:compatibility.adoc#network-requirements[Network Requirements]. | ||
| ** 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]. | ||
| * Our https://forums.couchbase.com/c/scala-sdk/37[community forum] is a great source of help. | ||
| ** If you have a consumer-grade router that has problems with DNS-SRV records, review xref:howtos:troubleshooting-cloud-connections.adoc#troubleshooting-host-not-found[Troubleshooting Guide]. | ||
| * The https://forums.couchbase.com/c/scala-sdk/37[community forum] is a great source of help. | ||
| //// | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whilst making a change here, it would also be a good idea to put in the line break for the new sentence. 👍