> For the complete documentation index, see [llms.txt](https://db.coolstone.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://db.coolstone.dev/4/core/get.md).

# Get

## Get Record From Tag <a href="#from-tag" id="from-tag"></a>

{% code lineNumbers="true" %}

```javascript
db.get('tag')
```

{% endcode %}

<table><thead><tr><th>Parameter</th><th>About</th><th>Type</th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>tag</td><td>The Record's tag</td><td>String</td><td>true</td></tr></tbody></table>

## Read <a href="#content" id="content"></a>

{% tabs %}
{% tab title="DB level" %}

```javascript
await db.read('tag')
```

{% endtab %}

{% tab title="Record level" %}
{% code lineNumbers="true" %}

```javascript
await db.get('tag').read()
```

{% endcode %}
{% endtab %}
{% endtabs %}

## Get Path <a href="#path" id="path"></a>

{% tabs %}
{% tab title="Locate method" %}
{% code lineNumbers="true" %}

```javascript
db.locate('tag')
```

{% endcode %}

<table><thead><tr><th>Parameter</th><th>About</th><th>Type</th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>tag</td><td>Record's tag</td><td>string</td><td>true</td></tr></tbody></table>
{% endtab %}

{% tab title="Path property" %}
{% code lineNumbers="true" %}

```javascript
db.get('tag').path
```

{% endcode %}
{% endtab %}
{% endtabs %}

## Get Tag <a href="#tag" id="tag"></a>

{% code lineNumbers="true" %}

```javascript
db.get('tag').tag
```

{% endcode %}

## Exists <a href="#exists" id="exists"></a>

{% hint style="info" %}
This will only return `true` or `false`.
{% endhint %}

{% code lineNumbers="true" %}

```javascript
await db.has('tag')
```

{% endcode %}

<table><thead><tr><th>Parameter</th><th>About</th><th>Type</th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>tag</td><td>The tag to check for</td><td>String</td><td>true</td></tr></tbody></table>

## Get All Records

{% code lineNumbers="true" %}

```javascript
await db.getAll({tagOnly:false, limit:10, filter})
```

{% endcode %}

<table><thead><tr><th>Parameter</th><th>About</th><th>Type</th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>options.tagOnly</td><td>Set to true to return an array of tags instead of Records</td><td>Boolean</td><td>false</td></tr><tr><td>options.limit</td><td>Max results</td><td>Number</td><td>false</td></tr><tr><td>options.filter</td><td>Filter results</td><td>Function</td><td>false</td></tr></tbody></table>

## Find Record

Similar to `getAll`, but returns the first match.

{% code lineNumbers="true" %}

```javascript
await db.find(tag => {})
```

{% endcode %}

<table><thead><tr><th>Parameter</th><th>About</th><th>Type</th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>filter</td><td>Filter results</td><td>Function</td><td>false</td></tr></tbody></table>


---

# 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://db.coolstone.dev/4/core/get.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.
