Skip to content

Commit e18ffc3

Browse files
committed
Merge branch 'develop'
* develop: update node documentation
2 parents 8316ae8 + 81ae70e commit e18ffc3

File tree

1 file changed

+19
-14
lines changed

1 file changed

+19
-14
lines changed

77-cloudant-cf.html

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -292,19 +292,24 @@
292292
A simple Cloudant output node. Stores <b>msg</b> in a chosen database.
293293
</p>
294294
<p>
295-
Cloudant generates a random id for the <b>msg._id</b> property if one
295+
Cloudant generates a random id for the <code>_id</code> property if one
296296
is not specified and a new document will be <b>inserted</b> each time.
297-
If you want to <b>update</b> an existing document you must specify a
298-
value for <b>msg._id</b> in your object.
299-
</p>
300-
<p>
301-
You can <b>insert</b> only the <b>payload</b> by checking the checkbox
302-
in the configuration window.
297+
You can <b>insert</b> only the <code>msg.payload</code> by checking the
298+
checkbox in the configuration window.
299+
</p>
300+
<p>
301+
If you want to <b>update</b> an existing document you must specify the
302+
latest values for <code>_id</code> and <code>_rev</code> in your object.
303+
If they don't match the current values stored in the database you will
304+
receive a <b>conflict error</b> message, so make sure you are using the
305+
most updated information for the document.
303306
</p>
304307
<p>
305308
It is also possible to <b>delete</b> documents from the database by
306-
providing values for <b>msg.payload._id</b> and <b>msg.payload._rev</b>
307-
and selecting the <b>remove</b> option for the node.
309+
providing values for <code>_id</b> and <code>_rev</code> and selecting
310+
the <b>remove</b> option for the node. You can pass these values in the
311+
<code>msg</code> object itself or as an object in the
312+
<code>msg.payload</code>.
308313
</p>
309314
</script>
310315

@@ -314,18 +319,18 @@
314319
</p>
315320
<p>
316321
Searching for a document can be done in two modes: directly by using the
317-
document <b>_id</b> or by using an existing <a
322+
document's <b>_id</b> or by using an existing <a
318323
href="https://cloudant.com/for-developers/search/" target="_blank">Search
319324
Index</a>.
320325
</p>
321326
<p>
322-
When querying using the <b>_id</b> option, the <code>_id</code> should be
323-
passed in the <code>msg.payload</code> as a string.
327+
When querying using the <b>_id</b> option, the value for <code>_id</code>
328+
should be passed in the <code>msg.payload</code> as a string.
324329
</p>
325330
<p>
326331
To use an existing <b>Search Index</b> stored on the desired database, the
327332
query argument should be passed on the <code>msg.payload</code> following
328-
the <code>indexName:value</code> pattern. The index must be created beforehand
329-
on the database.
333+
the <code>indexName:value</code> pattern. <i>The index must be created
334+
beforehand on the database.</i>
330335
</p>
331336
</script>

0 commit comments

Comments
 (0)