← All notes

CouchDB Mango queries use a custom _index when one exists

Answer: 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.

_find and _index

Find documents using a declarative JSON querying syntax. The selector is required. A custom index is specified using the _index endpoint.

Creating indices in Mango

The supported actions cover the four normal CRUD operations, plus one meta action that creates indices on the database. The API adds one URI endpoint onto the existing CouchDB HTTP API. Creating databases, authentication, and Map/Reduce views stay available; other existing behavior is still supported. The general principle is to stay simple for clients, and to give users a more natural conversion to Apache CouchDB.

See also

Claims

Sources

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.

License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Apache CouchDB, /{db}/_find; Apache CouchDB, Mango README. Apache-2.0; Apache-2.0.

Cite this

Permanent ID: iil:note:jax44etf

iinventedlight. 2026. "CouchDB Mango queries use a custom _index when one exists." iinventedlight Library, iil:note:jax44etf, version of 2026-11-20. https://iinventedlight.com/library/notes/couchdb-mango-indexes/. License: CC-BY-4.0.

@misc{iil_note_jax44etf,
  author = {{iinventedlight}},
  title = {{CouchDB Mango queries use a custom \_index when one exists}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-20},
  url = {https://iinventedlight.com/library/notes/couchdb-mango-indexes/},
  note = {Permanent ID iil:note:jax44etf. License: CC-BY-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).

Extra files beside this note

These files use this note's license, shown below. Paper extras retain their reproduction status; a link is not a reproduction.

All artifact files (JSON index)

For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/couchdb-mango-indexes.md.