Skip to content

Commit

Permalink
DOC-7797 -- Reserved Keys (couchbase#420)
Browse files Browse the repository at this point in the history
  • Loading branch information
ibsoln authored Mar 5, 2021
1 parent 0a0855c commit 3573d82
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions modules/ROOT/pages/_partials/commons/common-document.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
:topic-group: Topic Group -- Data Model
include::{root-partials}block-abstract.adoc[]

:fn-rsvd-wds: footnote:fn1[Any change to this reserved key will be detected when it is saved and will result in a Couchbase exception (Error Code 5 -- `CorruptRevisionData`)]
:fnref-rsvd-wds: footnote:fn1[]

== Overview

In Couchbase Lite, a document's body takes the form of a JSON object -- a collection of key/value pairs where the values can be different types of data such as numbers, strings, arrays or even nested objects.
Expand Down Expand Up @@ -47,6 +50,8 @@ include::{snippet}[tag=update-document,indent=0]
----
====

NOTE: Any user change to the value of reserved keys (`_id`, `_rev` or `_deleted`) will be detected when a document is saved and will result in an exception (Error Code 5 -- `CorruptRevisionData`) -- see also <<document-constraints>>.


== Typed Accessors

Expand Down Expand Up @@ -113,6 +118,7 @@ include::{snippet}[tag=document-listener,indent=0]

include::{root-partials}document-expiration.adoc[]

[#lbl-doc-constraints]
== Document Constraints

Couchbase Lite APIs do not explicitly disallow the use of attributes with the underscore prefix at the top level of document.
Expand All @@ -130,10 +136,11 @@ For more guidance -- see: xref:sync-gateway:ROOT:data-modeling.adoc[Sync Gateway
.Reserved Keys List
====
* _attachments
* _id
* _deleted
* _deleted {fn-rsvd-wds}
* _id {fnref-rsvd-wds}
* _removed
* _rev
* _rev {fnref-rsvd-wds}
* _sequence
====


Expand Down

0 comments on commit 3573d82

Please sign in to comment.