You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by Apache Wiki <wi...@apache.org> on 2010/04/08 18:47:04 UTC
[Couchdb Wiki] Trivial Update of "HTTP_Document_API" by SebastianCohnen
Dear Wiki user,
You have subscribed to a wiki page or wiki category on "Couchdb Wiki" for change notification.
The "HTTP_Document_API" page has been changed by SebastianCohnen.
The comment on this change is: cleanup.
http://wiki.apache.org/couchdb/HTTP_Document_API?action=diff&rev1=61&rev2=62
--------------------------------------------------
"Body":"I decided today that I don't like baseball. I like plankton."
}
}}}
+
=== Special Fields ===
Note that any top-level fields with a name that starts with a ''_'' prefix are reserved for use by CouchDB itself. Also see [[Reserved_words]]. Currently (0.10+) reserved fields are:
- ||'''Field Name'''||'''Description'''||
+ ||'''Field Name'''||'''Description'''||
- ||''_id''|| The unique identifier of the document ('''mandatory''' and '''immutable''')||
+ ||''_id''|| The unique identifier of the document ('''mandatory''' and '''immutable''')||
- ||''_rev''|| The current MVCC-token/revision of this document ('''mandatory''' and '''immutable''')||
+ ||''_rev''|| The current MVCC-token/revision of this document ('''mandatory''' and '''immutable''')||
- ||''_attachments''|| If the document has attachments, _attachments holds a (meta-)data structure (see section on [[HTTP_Document_API#Attachments||attachments]])||
+ ||''_attachments''|| If the document has attachments, _attachments holds a (meta-)data structure (see section on [[HTTP_Document_API#Attachments||attachments]])||
- ||''_deleted''|| Indicates that this document has been deleted and will be removed on next compaction run||
+ ||''_deleted''|| Indicates that this document has been deleted and will be removed on next compaction run||
- ||''_revisions''|| If the document was requested with ''?revs=true'' this field will hold a simple list of the documents history||
+ ||''_revisions''|| If the document was requested with ''?revs=true'' this field will hold a simple list of the documents history||
- ||''_rev_infos''|| Similar to ''_revisions'', but more details about the history and the availability of ancient versions of the document||
+ ||''_rev_infos''|| Similar to ''_revisions'', but more details about the history and the availability of ancient versions of the document||
- ||''_conflicts''|| Information about conflicts||
+ ||''_conflicts''|| Information about conflicts||
- ||''_deleted_conflicts''|| Information about conflicts||
+ ||''_deleted_conflicts''|| Information about conflicts||
==== Document IDs ====
Document IDs don't have restrictions on what characters can be used. Although it should work, it is recommended to use non-special characters for document IDs. Using special characters you have to be aware of proper URL en-/decoding. Documents prefixed with ''_'' are special documents:
- ||'''Document ID prefix'''||'''Description'''||
+ ||'''Document ID prefix'''||'''Description'''||
- ||''_design/''|| are [[DesignDocuments]] ||
+ ||''_design/''|| are [[DesignDocuments]] ||
- ||''_local/''|| are not being replicated (local documents) and used for [[Replication||replication]] checkpointing. ||
+ ||''_local/''|| are not being replicated (local documents) and used for [[Replication||replication]] checkpointing. ||
You can have '''/''' as part of the document ID but if you refer to a document in a URL you must always encode it as '''%2F'''. One special case is '''_design/''' documents, those accept either '''/''' or '''%2F''' for the '''/''' after ''_design'', although '''/''' is preferred and '''%2F''' is still needed for the rest of the DocID.
@@ -91, +92 @@
"Body":"I decided today that I don't like baseball. I like plankton."
}
}}}
+
==== Accessing Previous Revisions ====
See DocumentRevisions for additional notes on revisions.