# 3. Querying CouchDB

CouchDB supports special documents within databases known as “design documents”. These documents, mostly driven by JavaScript you write, are used to build indexes, validate document updates, format query results, and filter replications.

- 3.1. Design Documents
  - 3.1.1. Creation and Structure
  - 3.1.2. View Functions
  - 3.1.3. Show Functions
  - 3.1.4. List Functions
  - 3.1.5. Update Functions
  - 3.1.6. Filter Functions
  - 3.1.7. Validate Document Update Functions
- 3.2. Guide to Views
  - 3.2.1. Introduction to Views
  - 3.2.2. Views Collation
  - 3.2.3. Joins With Views
  - 3.2.4. View Cookbook for SQL Jockeys
  - 3.2.5. Pagination Recipe
- 3.3. Mango Queries
  - 3.3.1. Selectors
  - 3.3.2. Indexes
- 3.4. Search
  - 3.4.1. Index functions
  - 3.4.2. Analyzers
  - 3.4.3. Queries
  - 3.4.4. Query syntax
  - 3.4.5. Geographical searches
  - 3.4.6. Highlighting search terms
- 3.5. Nouveau
  - 3.5.1. Lucene Version Upgrade
  - 3.5.2. Field Types
  - 3.5.3. Index functions
  - 3.5.4. Analyzers
  - 3.5.5. Queries
  - 3.5.6. Query syntax

Note: Previously, the functionality provided by CouchDB’s design documents, in combination with document attachments, was referred to as “CouchApps.” The general principle was that entire web applications could be hosted in CouchDB, without need for an additional application server.

Use of CouchDB as a combined standalone database and application server is no longer recommended. There are significant limitations to a pure CouchDB web server application stack, including but not limited to: fully-fledged fine-grained security, robust templating and scaffolding, complete developer tooling, and most importantly, a thriving ecosystem of developers, modules and frameworks to choose from.

The developers of CouchDB believe that web developers should pick “the right tool for the right job”. Use CouchDB as your database layer, in conjunction with any number of other server-side web application frameworks, such as the entire Node.JS ecosystem, Python’s Django and Flask, PHP’s Drupal, Java’s Apache Struts, and more.