---
source: https://iinventedlight.com/library/notes/couchdb-mango-queries.md
title: "CouchDB _find runs a declarative Mango selector against a database"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "Apache-2.0 (Apache CouchDB); Apache-2.0 (Apache CouchDB); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "Summary by iinventedlight (AI-assisted). Sources: Apache CouchDB, /{db}/_find; Apache CouchDB, Mango README. Apache-2.0; Apache-2.0."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-20
status: published
approved_by: "Cole Withington, 2026-11-20 13:14 PT: \"Publish the full batch and rewrite the 6 live notes\""
checked_on: 2026-11-20
as_of: 2026-11-20
confidence: medium
untested: "Not reproduced (2026-11-20). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-systems: CouchDB Mango _find queries"
tags: [couchdb, mango, query, databases]
client: Librarian
sources:
  - id: S1
    title: "/{db}/_find"
    publisher: Apache CouchDB
    url: https://docs.couchdb.org/en/stable/api/database/find.html
    accessed: 2026-11-20
    license: "Apache-2.0"
  - id: S2
    title: "Mango README"
    publisher: Apache CouchDB
    url: https://raw.githubusercontent.com/apache/couchdb/main/src/mango/README.md
    accessed: 2026-11-20
    license: "Apache-2.0"
---
# CouchDB _find runs a declarative Mango selector against a database
**Answer:** POST /{db}/_find finds documents using a declarative JSON querying syntax. The request Content-Type is application/json. The required selector is a JSON object describing criteria used to select documents.

## Request fields

- `selector` JSON object describing criteria used to select documents; required
- `limit` maximum number of results returned; default is 25
- `skip` skip the first n results
- `fields` JSON array specifying which fields of each object should be returned

If fields is omitted, the entire object is returned. sort is an optional JSON array following sort syntax. Queries use custom indexes specified using the `_index` endpoint, if available. If none is available, and the planner allows it, they fall back to the built-in `_all_docs` index, which can be slow.

## The find action in Mango

Mango provides a query language interface for Apache CouchDB. The find action has a selector, plus optional limit (default: 25) and skip (default: 0). The HTTP API accepts a JSON body. That body may be one JSON object, or a JSON array listing actions that are then invoked serially. Multiple commands can be batched into one HTTP request, but a batch of commands has no guarantees about atomicity or isolation.

## See also

- [postgres-json-jsonb](https://iinventedlight.com/library/notes/postgres-json-jsonb/)
- [sqlite-json](https://iinventedlight.com/library/notes/sqlite-json/)
- [couchdb-replication](https://iinventedlight.com/library/notes/couchdb-replication/)

## Claims

- id: C1
  claim: _find is a POST that selects documents with a required JSON selector.
  source: S1
  evidence: "Find documents using a declarative JSON querying syntax."

- id: C2
  claim: The default limit is 25, and skip, sort, and fields are optional.
  source: S1
  evidence: "Maximum number of results returned. Default is 25"

- id: C3
  claim: Mango's find action takes a selector plus optional limit and skip, with the same default limit of 25.
  source: S2
  evidence: "limit (optional) (default: 25) - integer >= 0, Limit the number of rows returned"

## Sources

- [S1] /{db}/_find. Apache CouchDB. https://docs.couchdb.org/en/stable/api/database/find.html . License: Apache-2.0. Accessed 2026-11-20.

- [S2] Mango README. Apache CouchDB. https://raw.githubusercontent.com/apache/couchdb/main/src/mango/README.md . License: Apache-2.0. Accessed 2026-11-20.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Apache CouchDB, /{db}/_find; Apache CouchDB, Mango README. Apache-2.0; Apache-2.0. Text was condensed and changed from the originals.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
