Apache CouchDB® Logo

Table of Contents

User Guides

  • 1. Introduction
  • 2. Replication
  • 3. Design Documents
    • 3.1. Design Documents
    • 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. Search
    • 3.4. Nouveau
  • 4. Best Practices

Administration Guides

  • 1. Installation
  • 2. Setup
  • 3. Configuration
  • 4. Cluster Management
  • 5. Maintenance
  • 6. Fauxton
  • 7. Experimental Features

Reference Guides

  • 1. API Reference
  • 2. JSON Structure Reference
  • 3. Query Server
  • 4. Partitioned Databases

Other

  • 1. Release Notes
  • 2. Security Issues / CVEs
  • 3. Reporting New Security Problems with Apache CouchDB
  • 4. License
  • 5. Contributing to this Documentation

Quick Reference Guides

  • API Quick Reference
  • Configuration Quick Reference

More Help

  • CouchDB Homepage
  • Mailing Lists
  • Realtime Chat
  • Issue Tracker
  • Download Docs
Apache CouchDB®
  • 3. Design Documents
  • 3.2. Guide to Views
  • View page source

3.2. Guide to Views

Views are the primary tool used for querying and reporting on CouchDB documents. There you’ll learn how they work and how to use them to build effective applications with CouchDB.

  • 3.2.1. Introduction to Views
    • 3.2.1.1. What Is a View?
    • 3.2.1.2. Efficient Lookups
      • 3.2.1.2.1. Find One
      • 3.2.1.2.2. Find Many
      • 3.2.1.2.3. Reversed Results
    • 3.2.1.3. The View to Get Comments for Posts
    • 3.2.1.4. Reduce/Rereduce
    • 3.2.1.5. One vs. Multiple Design Documents
    • 3.2.1.6. Lessons Learned
    • 3.2.1.7. Wrapping Up
  • 3.2.2. Views Collation
    • 3.2.2.1. Basics
    • 3.2.2.2. Examples
    • 3.2.2.3. Sorting by Dates
    • 3.2.2.4. String Ranges
    • 3.2.2.5. Collation Specification
      • 3.2.2.5.1. Key ranges
      • 3.2.2.5.2. Complex keys
    • 3.2.2.6. _all_docs
    • 3.2.2.7. Raw collation
  • 3.2.3. Joins With Views
    • 3.2.3.1. Linked Documents
    • 3.2.3.2. Using View Collation
      • 3.2.3.2.1. Approach #1: Comments Inlined
      • 3.2.3.2.2. Approach #2: Comments Separate
      • 3.2.3.2.3. Optimization: Using the Power of View Collation
  • 3.2.4. View Cookbook for SQL Jockeys
    • 3.2.4.1. Using Views
      • 3.2.4.1.1. Defining a View
      • 3.2.4.1.2. Querying a View
      • 3.2.4.1.3. MapReduce Functions
      • 3.2.4.1.4. Map functions
    • 3.2.4.2. Look Up by Key
    • 3.2.4.3. Look Up by Prefix
    • 3.2.4.4. Aggregate Functions
    • 3.2.4.5. Get Unique Values
    • 3.2.4.6. Enforcing Uniqueness
  • 3.2.5. Pagination Recipe
    • 3.2.5.1. Example Data
    • 3.2.5.2. A View
    • 3.2.5.3. Setup
    • 3.2.5.4. Paging
    • 3.2.5.5. Paging (Alternate Method)
    • 3.2.5.6. Jump to Page
Previous Next

© Copyright 2025, Apache Software Foundation. CouchDB® is a registered trademark of the Apache Software Foundation.

Built with Sphinx using a theme provided by Read the Docs.