CouchDB 1.1 Manual

Abstract

This manual documents the CouchDB 1.1 database system, including the installation, functionality, and CouchDB API.

Last document update: 21 Feb 2012 20:09; Document built: 21 Feb 2012 20:9.


Table of Contents

1. Introduction
1.1. Using Futon
1.1.1. Managing Databases and Documents
1.1.2. Configuring Replication
1.2. Using curl
2. Features and Functionality
2.1. HTTP Range Requests
2.2. HTTP Proxying
2.3. CommonJS support for map functions
2.4. Granular ETag support
3. Replication
3.1. Replicator Database
3.1.1. Basics
3.1.2. Documents describing the same replication
3.1.3. Canceling replications
3.1.4. Server restart
3.1.5. Changing the Replicator Database
3.1.6. Replicating the replicator database
3.1.7. Delegations
4. CouchDB API
4.1. Request Format and Responses
4.2. HTTP Headers
4.2.1. Request Headers
4.2.2. Response Headers
4.3. JSON Basics
4.4. HTTP Status Codes
4.5. CouchDB API Overview
5. CouchDB API Server Database Methods
5.1. GET /db
5.2. PUT /db
5.3. DELETE /db
5.4. GET /db/_changes
5.4.1. Filtering
5.5. POST /db/_compact
5.6. POST /db/_compact/design-doc
5.7. POST /db/_view_cleanup
5.8. POST /db/_ensure_full_commit
5.9. POST /db/_bulk_docs
5.9.1. Inserting Documents in Bulk
5.9.2. Updating Documents in Bulk
5.9.3. Bulk Documents Transaction Semantics
5.9.4. Bulk Document Validation and Conflict Errors
5.10. POST /db/_temp_view
5.11. POST /db/_purge
5.11.1. Updating Indexes
5.12. GET /db/_all_docs
5.13. POST /db/_all_docs
5.14. POST /db/_missing_revs
5.15. POST /db/_revs_diff
5.16. GET /db/_security
5.17. PUT /db/_security
5.18. GET /db/_revs_limit
5.19. PUT /db/_revs_limit
6. CouchDB API Server Document Methods
6.1. POST /db
6.1.1. Specifying the Document ID
6.1.2. Batch Mode Writes
6.1.3. Including Attachments
6.2. GET /db/doc
6.2.1. Attachments
6.2.2. Getting a List of Revisions
6.2.3. Obtaining an Extended Revision History
6.2.4. Obtaining a Specific Revision
6.3. HEAD /db/doc
6.4. PUT /db/doc
6.4.1. Updating an Existing Document
6.5. DELETE /db/doc
6.6. COPY /db/doc
6.6.1. Copying a Document
6.6.2. Copying from a Specific Revision
6.6.3. Copying to an Existing Document
6.7. GET /db/doc/attachment
6.8. PUT /db/doc/attachment
6.8.1. Updating an Existing Attachment
6.9. DELETE /db/doc/attachment
7. CouchDB API Server Local (non-replicating) Document Methods
7.1. GET /db/_local/local-doc
7.2. PUT /db/_local/local-doc
7.3. DELETE /db/_local/local-doc
7.4. COPY /db/_local/local-doc
8. CouchDB API Server Design Document Methods
8.1. GET /db/_design/design-doc
8.2. PUT /db/_design/design-doc
8.3. DELETE /db/_design/design-doc
8.4. COPY /db/_design/design-doc
8.4.1. Copying a Design Document
8.4.2. Copying from a Specific Revision
8.4.3. Copying to an Existing Design Document
8.5. GET /db/_design/design-doc/attachment
8.6. PUT /db/_design/design-doc/attachment
8.7. DELETE /db/_design/design-doc/attachment
8.8. GET /db/_design/design-doc/_info
8.9. GET /db/_design/design-doc/_view/view-name
8.9.1. Querying Views and Indexes
8.9.2. Sorting Returned Rows
8.9.3. Specifying Start and End Values
8.9.4. Using Limits and Skipping Rows
8.9.5. View Reduction and Grouping
8.10. POST /db/_design/design-doc/_view/view-name
8.10.1. Multi-document Fetching
8.11. POST /db/_design/design-doc/_show/show-name
8.12. POST /db/_design/design-doc/_show/show-name/doc
8.13. GET /db/_design/design-doc/_list/list-name/other-design-doc/view-name
8.14. POST /db/_design/design-doc/_list/list-name/other-design-doc/view-name
8.15. GET /db/_design/design-doc/_list/list-name/view-name
8.16. POST /db/_design/design-doc/_list/list-name/view-name
8.17. PUT /db/_design/design-doc/_update/updatename/doc
8.18. POST /db/_design/design-doc/_update/updatename
8.19. ALL /db/_design/design-doc/_rewrite/rewrite-name/anything
9. CouchDB API Server Miscellaneous Methods
9.1. GET /
9.2. GET /_active_tasks
9.3. GET /_all_dbs
9.4. GET /_log
9.5. POST /_replicate
9.5.1. Replication Operation
9.5.2. Specifying the Source and Target Database
9.5.3. Single Replication
9.5.4. Continuous Replication
9.5.5. Canceling Continuous Replication
9.6. POST /_restart
9.7. GET /_stats
9.8. GET /_utils
9.9. GET /_uuids
9.10. GET /favicon.ico
10. CouchDB API Server Configuration Methods
10.1. GET /_config
10.2. GET /_config/section
10.3. GET /_config/section/key
10.4. PUT /_config/section/key
10.5. DELETE /_config/section/key
11. CouchDB API Server Authentication Methods
12. Configuring CouchDB
12.1. CouchDB Configuration Files
12.2. Configuration File Locations
12.3. MochiWeb Server Options
12.4. OS Daemons
12.5. Update Notifications
12.6. Socket Options Configuration Setting
12.7. vhosts definitions
12.8. Configuring SSL Network Sockets
12.9. CouchDB Configuration Options
12.9.1. attachments Configuration Options
12.9.2. couchdb Configuration Options
12.9.3. daemons Configuration Options
12.9.4. httpd_db_handlers Configuration Options
12.9.5. couch_httpd_auth Configuration Options
12.9.6. httpd Configuration Options
12.9.7. httpd_design_handlers Configuration Options
12.9.8. httpd_global_handlers Configuration Options
12.9.9. log Configuration Options
12.9.10. query_servers Configuration Options
12.9.11. query_server_config Configuration Options
12.9.12. replicator Configuration Options
12.9.13. stats Configuration Options
12.9.14. uuids Configuration Options
A. JSON Structure Reference

List of Figures

1.1. Futon Overview
1.2. Creating a Database
1.3. Editing a Document
1.4. Edited Document
1.5. Replication Form

List of Tables

5.1. Database API Calls
5.2. CouchDB database information object
5.3. Changes information for a database
5.4. Bulk Documents
5.5. Conflicts on Bulk Inserts
5.6. Bulk Document Response
5.7. All Database Documents
5.8. Security Object
6.1. Document API Calls
6.2. CouchDB Document
6.3. Document with Attachments
6.4. Returned Document with Attachments
6.5. Returned CouchDB Document with Revision Info
6.6. Returned CouchDB Document with Detailed Revision Info
7.1. Local (non-replicating) Document API Calls
8.1. Design Document API Calls
8.2. Design Document
8.3. Design Document Info JSON Contents
9.1. Miscellaneous API Calls
9.2. List of Active Tasks
9.3. Replication Settings
9.4. Replication Status
9.5. couchdb statistics
9.6. httpd_request_methods statistics
9.7. httpd_status_codes statistics
9.8. httpd statistics
10.1. Configuration API Calls
11.1. Authentication API Calls
12.1. Configuration Groups
12.2. Configuration Groups
12.3. Configuration Groups
12.4. Configuration Groups
12.5. Configuration Groups
12.6. Configuration Groups
12.7. Configuration Groups
12.8. Configuration Groups
12.9. Configuration Groups
12.10. Configuration Groups
12.11. Configuration Groups
12.12. Configuration Groups
12.13. Configuration Groups
12.14. Configuration Groups
12.15. Configuration Groups
A.1. JSON Structures
A.2. All Database Documents
A.3. Bulk Document Response
A.4. Bulk Documents
A.5. Changes information for a database
A.6. CouchDB Document
A.7. CouchDB Error Status
A.8. CouchDB database information object
A.9. Design Document
A.10. Design Document Information
A.11. Design Document spatial index Information
A.12. Document with Attachments
A.13. List of Active Tasks
A.14. Replication Settings
A.15. Replication Status
A.16. Returned CouchDB Document with Detailed Revision Info
A.17. Returned CouchDB Document with Revision Info
A.18. Returned Document with Attachments
A.19. Security Object