# Find One

**Find One** node is designed to retrieve a single specific record from a database based on a given query. It's analogous to finding a particular piece of information that matches specified conditions.

This node is particularly useful when you need to fetch a unique record or when you're certain that only one record matches your criteria. If multiple records match the query, only the first matching record will be returned.

### Properties Panel

<table data-header-hidden><thead><tr><th width="156"></th><th width="351"></th><th></th></tr></thead><tbody><tr><td><strong>Field</strong></td><td><strong>Description</strong></td><td><strong>Required</strong></td></tr><tr><td>Node name</td><td><a href="/pages/jJ1qO0Ju8d7VFyPB2Jy3">Node Name</a></td><td>true</td></tr><tr><td>Database collection</td><td>Database collection in which you want to find that specific information</td><td>true</td></tr><tr><td>Query</td><td>Query to identify which documents needs to be modified</td><td>false</td></tr><tr><td>Projection</td><td>Specifies which fields to include or exclude in the result</td><td>false</td></tr></tbody></table>

### Usage

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

### Returns

`result` - The matching document from the database. If no document matches the query, this will be `null`. 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 a user by their email address and retrieve only their name and age:

1. Set Database Collection to `users`
2. Set Query to `{ "email": {"$eq": "user@example.com" } }`
3. Set Projection to `{ "name": 1, "age": 1, "_id": 0 }`

This will return a result like:

```
{
  "name": "John Doe",
  "age": 30
}
```

### Best Practices

* Ensure your query is specific enough to return only one document, or be prepared to handle cases where the first matching document may not be the one you want.
* Use indexing on frequently queried fields to improve performance.
* Be cautious with projections to avoid exposing sensitive data.


---

# 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-one.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.
