# Find Many

**Find Many** node is designed to retrieve multiple records from a database based on a given query. It's useful when you need to fetch a set of documents that match specific criteria.

This node is particularly valuable when you want to retrieve multiple records that share certain characteristics or when you need to perform operations on a subset of your data.

### Properties Panel

| **Field**           | **Description**                                                        | **Required** |
| ------------------- | ---------------------------------------------------------------------- | ------------ |
| Node name           | [Node Name](/flow-builder/node-name.md)                                | true         |
| Database collection | Database collection from which you want to retrieve multiple documents | true         |
| Query               | Query to identify which documents need to be retrieved                 | false        |
| Projection          | Specifies which fields to include or exclude in the result             | false        |

### Usage

1. Select the database collection you want to search.
2. Define your query to match the desired records. For example: `{ "status": { "$eq": "active" } }`
3. (Optional) Specify a projection to include only relevant fields. For example: `{ "name": 1, "email": 1, "_id": 0 }`

### Returns

`result` - An array of documents from the database that match the query. If no documents match the query, this will be an empty array.. You can access this using Magical Autocomplete (e.g. `$.<node_name>.result`) in any node below this node.

### Example

Let's say you want to find all users who are over 18 years old, retrieve only their names and ages:

1. Set Database Collection to `users`
2. Set Query to `{ "age": { "$gt": 18 } }`
3. Set Projection to `{ "name": 1, "age": 1, "_id": 0 }`

This will return a result like:

```json
[
  {
    "name": "Alice Johnson",
    "age": 35
  },
  {
    "name": "Bob Smith",
    "age": 28
  },
  {
    "name": "Charlie Brown",
    "age": 22
  },
  ...
]
```

### Best Practices

* Use indexing on frequently queried fields to improve performance.
* Be cautious with projections to avoid exposing sensitive data.
* When possible, use specific queries to reduce the number of documents that need to be scanned.


---

# Agent Instructions: 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:

```
GET https://docs.cosmocloud.io/flow-builder/node-types/database-nodes/find-many.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
