couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Couchdb Wiki] Trivial Update of "HttpDocumentApi" by GavinRoy
Date Tue, 10 Jun 2008 14:53:50 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Couchdb Wiki" for change notification.

The following page has been changed by GavinRoy:
http://wiki.apache.org/couchdb/HttpDocumentApi

The comment on the change is:
Change use of name to id where appropriate to make the document more consistent

------------------------------------------------------------------------------
  Documents stored in a CouchDB have a DocID. DocIDs are case-sensitive string identifiers
that uniquely identify a document. Two documents cannot have the same identifier in the same
database, they are considered the same document.
  
  {{{
- http://localhost:5984/test/some_doc_name
+ http://localhost:5984/test/some_doc_id
- http://localhost:5984/test/another_doc_name
+ http://localhost:5984/test/another_doc_id
  http://localhost:5984/test/BA1F48C5418E4E68E5183D5BD1F06476
  }}}
  
- The above URLs point to ''some_doc_name'', ''another_doc_name'' and ''BA1F48C5418E4E68E5183D5B!D1F06476''
in the database ''test''.
+ The above URLs point to ''some_doc_id'', ''another_doc_id'' and ''BA1F48C5418E4E68E5183D5B!D1F06476''
in the database ''test''.
  
- === Valid Document Names ===
+ === Valid Document Ids ===
  
-   Q: What's the rule on a valid document name? The examples suggest it's restricted to ''[a-zA-Z0-9_]''?
What about multi-byte UTF-8 characters? Any other non alphanums other than ''_''?
+   Q: What's the rule on a valid document id? The examples suggest it's restricted to ''[a-zA-Z0-9_]''?
What about multi-byte UTF-8 characters? Any other non alphanums other than ''_''?
  
-   A: There is no restriction yet on document names at the database level. However, I haven't
tested what happens when you try to use multibyte in the URL. It could be it "just works",
but most likely there is a multi-byte char escaping/encoding/decoding step that needs to be
done somewhere. For now, I'd just stick with valid URI characters and nothing "special".
+   A: There is no restriction yet on document ids at the database level. However, I haven't
tested what happens when you try to use multibyte in the URL. It could be it "just works",
but most likely there is a multi-byte char escaping/encoding/decoding step that needs to be
done somewhere. For now, I'd just stick with valid URI characters and nothing "special".
  
    The reason database names have strict restrictions is to simplify database name-to-file
mapping. Since databases will need to replicate across operating systems, the file naming
scheme needed to be the lowest common denominator.
  
@@ -158, +158 @@

  To retrieve a document, simply perform a ''GET'' operation at the document's URL:
  
  {{{
- GET /somedatabase/some_doc_name HTTP/1.0
+ GET /somedatabase/some_doc_id HTTP/1.0
  Date: Thu, 17 Aug 2006 05:39:28 +0000GMT
  }}}
  
@@ -188, +188 @@

  The above example gets the current revision. You can get a specific revision by using the
following syntax:
  
  {{{
- GET /somedatabase/some_doc_name?rev=946B7D1C HTTP/1.0
+ GET /somedatabase/some_doc_id?rev=946B7D1C HTTP/1.0
  Date: Thu, 17 Aug 2006 05:39:28 +0000GMT
  }}}
  
  To find out what revisions are available for a document, you can do:
  
  {{{
- GET /somedatabase/some_doc_name?revs=true HTTP/1.0
+ GET /somedatabase/some_doc_id?revs=true HTTP/1.0
  Date: Thu, 17 Aug 2006 05:39:28 +0000GMT
  }}}
  

Mime
View raw message