Skip to content

Commit 4b0e2be

Browse files
DOC-3770 (#2799)
* DOC-3770 * fixes * bucket fix * Update development-intro.dita
1 parent d953f67 commit 4b0e2be

File tree

1 file changed

+24
-23
lines changed

1 file changed

+24
-23
lines changed

content/sdk/development-intro.dita

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
<section>
1414
<title>Using Couchbase</title>
1515
<p>Once you've <xref href="../install/install-intro.dita#topic_edn_wtd_54">installed the
16-
server</xref>, you can start storing, retrieving, and querying documents with
16+
server</xref>, and <xref href="../clustersetup/create-bucket.dita">created
17+
a test bucket</xref>, you can start storing, retrieving, and querying documents with
1718
Couchbase. You can start with an SDK, the command-line cbc tool, or the web
1819
browser.</p>
1920
<p>Every item in a database goes through the basic <i>CRUD</i> cycle, which is typical
@@ -40,84 +41,84 @@
4041
the command line client, don’t worry - we’ll walk through the steps in the next
4142
chapter.</p>
4243
</section>
43-
<section><title>Creating documents</title><p>Create the document <i>mnunberg.json</i>. It
44+
<section><title>Creating documents</title><p>Create the document <i>josmith.json</i>. It
4445
can be anywhere on your file
4546
system:</p><codeblock outputclass="language-json">{
46-
"name": "Mark Nunberg",
47-
"email": "mark.nunberg@couchbase.com",
47+
"name": "Jo Smith",
48+
"email": "jo.smith@example.com",
4849
"privs": ["admin"],
4950
"location": {
5051
"country": "United States",
5152
"state": "NV",
5253
"city": "Reno"
5354
},
5455
"following": [
55-
"u:tgreenstein", "u:ingenthr", "u:potus"
56+
"u:asmith", "u:bsmith", "u:potus"
5657
],
57-
"likes": ["doge", "pastries"]
58+
"likes": ["dogs", "pastries"]
5859
}</codeblock><p>Now,
5960
insert the document into Couchbase using the <i><codeph>cbc</codeph></i>
60-
utility:</p><screen>$ <b>cbc create -u <varname>username</varname> -P <varname>password</varname> -U couchbase://<varname>hostname-or-ip</varname>/default --mode insert mnunberg &lt; mnunberg.json</b></screen><codeph>mnunberg</codeph>
61+
utility:</p><screen>$ <b>cbc create -u <varname>username</varname> -P <varname>password</varname> -U couchbase://<varname>hostname-or-ip</varname>/myTestBucket --mode insert josmith &lt; josmith.json</b></screen><codeph>josmith</codeph>
6162
is the document’s ID, which is redirected (<codeph>&lt;</codeph>) to the
62-
<cmdname>cbc</cmdname> command’s standard input.</section>
63+
<cmdname>cbc</cmdname> command’s standard input.</section>
6364
<section>
6465
<title>Reading documents by ID</title>
6566
<p>Documents can be retrieved using their IDs. Retrieving a document by ID is extremely
6667
fast. The following query takes about 1 millisecond.</p>
67-
<screen>$ <b>cbc cat -u <varname>username</varname> -P <varname>password</varname> -U couchbase://<varname>hostname-or-ip</varname>/mnunberg</b>
68+
<screen>$ <b>cbc cat -u <varname>username</varname> -P <varname>password</varname> -U couchbase://<varname>hostname-or-ip</varname>/josmith</b>
6869
{
69-
"name": "Mark Nunberg",
70-
"email": "mark.nunberg@couchbase.com",
70+
"name": "Jo Smith",
71+
"email": "jo.smith@example.com",
7172
"privs": ["admin"],
7273
"location": {
7374
"country": "United States",
7475
"state": "NV",
7576
"city": "Reno"
7677
},
7778
"following": [
78-
"u:tgreenstein", "u:ingenthr", "u:potus"
79+
"u:asmith", "u:bsmith", "u:potus"
7980
],
80-
"likes": ["doge", "pastries"]
81+
"likes": ["dogs", "pastries"]
8182
}</screen>
8283
</section>
8384
<section>
8485
<title>Reading documents by querying</title>
8586
<p>Retrieving a document may be done using a unique identifier assigned by the
8687
application at the document’s creation, or by inspecting its contents to see if it
87-
matches a certain criteria. ID lookups are quicker, but querying documents allows
88+
matches a certain criterion. ID lookups are quicker, but querying documents allows
8889
for richer search capabilities (for example, "Give me all likes and followed users
89-
located in the US?" versus "Give me a user with the ID e3d882a4").</p>
90+
located in the US" versus "Give me a user with the ID e3d882a4").</p>
9091
<screen>$ <b>cbc n1ql \</b>
9192
<b>'SELECT following, likes FROM default WHERE location.country = "United States"'</b>
9293
{
9394
"following": [
94-
"u:tgreenstein",
95-
"u:ingenthr",
95+
"u:asmith",
96+
"u:bsmith",
9697
"u:potus"
9798
],
9899
"likes": [
99-
"doge",
100+
"dogs",
100101
"pastries"
101102
]
102103
</screen>
103104
</section>
104105
<section><title>Updating documents</title><p>Updating a document means changing the existing
105106
document. For example, take the file above and edit the <codeph>likes</codeph>
106107
field:</p><screen> ...
107-
"likes": ["doge", "pastries", <b>"couchbase"</b>]
108+
"likes": ["dogs", "pastries", <b>"couchbase"</b>]
108109
....</screen>Then
109110
use the <cmdname>cbc</cmdname> tool to update the document in
110-
Couchbase:<screen>$ <b>cbc create --mode replace mnunberg &lt; mnunberg.json</b></screen></section>
111+
Couchbase:<screen>$ <b>cbc create --mode replace josmith &lt; josmith.json</b></screen></section>
111112
<section>
112113
<title>Deleting documents</title>
113114
<p>This example shows how to delete the document with the ID
114-
<codeph>mnunberg</codeph>.</p>
115-
<screen>$ <b>cbc rm mnunberg</b></screen>
115+
<codeph>josmith</codeph>.</p>
116+
<screen>$ <b>cbc rm josmith</b></screen>
116117
</section>
117118
<section>
118119
<title>Couchbase clients</title>
119120
<p>Clients access data by connecting to a Couchbase cluster over the network. The most
120-
common type of client is a Couchbase SDK which is a full programmatic API that
121+
common type of client is a Couchbase SDK, which is a full programmatic API that
121122
enables applications to take the best advantage of Couchbase. The command line
122123
client provides a quick and streamlined interface for simple access and is suitable
123124
if you just want to access an item without writing any code.</p>

0 commit comments

Comments
 (0)