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

## Get Record Information <a href="#info" id="info"></a>

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

{% tabs %}
{% tab title="Get" %}
{% code lineNumbers="true" %}

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

{% endcode %}
{% endtab %}

{% tab title="Read" %}

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

{% endtab %}
{% endtabs %}

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

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

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

{% endcode %}

{% code lineNumbers="true" %}

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

{% endcode %}
{% endtab %}

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

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

{% 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><tr><td>realpath</td><td>Return realpath</td><td>bool</td><td>false</td></tr></tbody></table>
{% endtab %}
{% endtabs %}

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

{% code lineNumbers="true" %}

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

{% endcode %}

## Get Database Name <a href="#all" id="all"></a>

{% hint style="info" %}
Names are derived from the directory's base name or can manually be set in config object when initializing.
{% endhint %}

{% code lineNumbers="true" %}

```javascript
db.name
```

{% endcode %}

## Get Record from Value <a href="#from-value" id="from-value"></a>

{% hint style="warning" %}
This checks if the record content is exactly the `value` param
{% endhint %}

{% code lineNumbers="true" %}

```javascript
db.getFromValue('value')
```

{% endcode %}

<table><thead><tr><th>Parameter</th><th>About</th><th>Type</th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>value</td><td>The value to get from</td><td>String</td><td>true</td></tr><tr><td>exact</td><td>Exact match?</td><td>Boolean</td><td>false</td></tr></tbody></table>

### Get from Key/Value pair

{% hint style="danger" %}

### JSON Only

This function iterates all records to find any with the matching key/value pair you provided.
{% endhint %}

{% code lineNumbers="true" %}

```javascript
db.getFromKeyValue('key', 'value', exact)
```

{% endcode %}

## Check if a Record exists <a href="#exists" id="exists"></a>

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

{% code lineNumbers="true" %}

```javascript
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

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

<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>


---

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