> For the complete documentation index, see [llms.txt](https://docs.codemash.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.codemash.io/api/database.md).

# Database

- [Collections](https://docs.codemash.io/api/database/collections.md): Overview of collection records API methods
- [Aggregate](https://docs.codemash.io/api/database/collections/aggregate.md): Execute MongoDb aggregate over your database
- [Change Responsibility](https://docs.codemash.io/api/database/collections/change-responsibility.md): Changes the responsible person of a document
- [Count](https://docs.codemash.io/api/database/collections/count.md): Get the amount of records in a collection.
- [Delete](https://docs.codemash.io/api/database/collections/delete.md): Deletes one document by a specified document id or filter.
- [Delete Many](https://docs.codemash.io/api/database/collections/delete-many.md): Deletes all the documents by a specified filter.
- [Distinct](https://docs.codemash.io/api/database/collections/distinct.md): Finds the distinct values for a specified field across a single collection and returns the results in an array.
- [Find](https://docs.codemash.io/api/database/collections/find.md): List records from specified collection
- [Find One](https://docs.codemash.io/api/database/collections/find-one.md): Gets record by specified database unique id or filter.
- [Insert](https://docs.codemash.io/api/database/collections/insert.md): Inserts a single document
- [Insert Many](https://docs.codemash.io/api/database/collections/insert-many.md): Inserts many documents
- [References](https://docs.codemash.io/api/database/collections/references.md): Overview of collection references
- [Replace](https://docs.codemash.io/api/database/collections/replace.md): Replace document by specified filter or Id.
- [Update](https://docs.codemash.io/api/database/collections/update.md): Partial document update.
- [Update Many](https://docs.codemash.io/api/database/collections/update-many.md): Updates many documents
- [Taxonomies](https://docs.codemash.io/api/database/taxonomies.md): Overview of taxonomy terms API methods
- [Find](https://docs.codemash.io/api/database/taxonomies/find.md): Overview of taxonomy find method


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.codemash.io/api/database.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
