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