# Create

## In Database

<pre class="language-javascript" data-line-numbers><code class="lang-javascript"><strong>db.create('tag', content, ttl)
</strong></code></pre>

<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 new Record's tag</td><td>String</td><td>true</td></tr><tr><td>content</td><td>The Record's content</td><td>Any</td><td>true</td></tr><tr><td>ttl</td><td>Record's time to live</td><td>Number</td><td>false</td></tr></tbody></table>

### TTL <a href="#ttl" id="ttl"></a>

When you create a Record, you can set a TTL for that Record.

### Retroactively Set

{% code lineNumbers="true" %}

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

{% endcode %}

#### Monitor TTL

By default, Dubnium will only check TTL when you read a Record. However, you can call `monitorTTL()` to auto check TTL. However, this will read metadata for **all** Records.

{% code lineNumbers="true" %}

```javascript
db.monitorTTL(interval)
```

{% endcode %}

| Parameter | About                         | Type   |
| --------- | ----------------------------- | ------ |
| interval  | Interval of time for checking | Number |

#### Stop Monitoring

{% code lineNumbers="true" %}

```javascript
db.stopTTLMonitor()
```

{% endcode %}

## Record Class

{% code lineNumbers="true" %}

```javascript
onst Record = require("dubnium/record")
new Record( path, dbInstance )
```

{% endcode %}

<table><thead><tr><th>Parameter</th><th>About</th><th>Type</th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>path</td><td>File path</td><td>String</td><td>true</td></tr><tr><td>dbInstance</td><td>Dubnium instance</td><td>Dubnium</td><td>true</td></tr></tbody></table>

## Clone <a href="#ttl" id="ttl"></a>

{% code lineNumbers="true" %}

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

{% endcode %}

<table><thead><tr><th>Parameter</th><th>About</th><th>Type</th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>target</td><td>Target directory to clone the record in.</td><td>String</td><td>true</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/4/core/create.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.
