# Manage

## Create Record <a href="#create" id="create"></a>

{% tabs %}
{% tab title="In database" %}
{% code lineNumbers="true" %}

```javascript
db.create('tag',content,options)
```

{% 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 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>options</td><td>writeFile options</td><td>Object</td><td>false</td></tr></tbody></table>
{% endtab %}

{% tab title="Standalone" %}
{% code lineNumbers="true" %}

```javascript
const { Record } = require("dubnium")
Record({ tag:"tag", dir:"./data", ext:"json", content })
```

{% endcode %}

<table><thead><tr><th>Parameter</th><th>About</th><th>Type</th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>config.tag</td><td>Record's tag</td><td>String</td><td>true</td></tr><tr><td>config.dir</td><td>Dir to create in</td><td>String</td><td>true</td></tr><tr><td>config.ext</td><td>File extension</td><td>String</td><td>false</td></tr><tr><td>config.content</td><td>Record content</td><td>Any</td><td>true</td></tr></tbody></table>
{% endtab %}
{% endtabs %}

## Delete Record <a href="#delete" id="delete"></a>

{% code lineNumbers="true" %}

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

{% endcode %}

No parameters

### Close

Delete **all** records & the directory

{% code lineNumbers="true" %}

```javascript
db.close()
```

{% endcode %}

No parameters

### Wipe

Delete **all** records & *preserve* the directory

{% code lineNumbers="true" %}

```javascript
db.wipe()
```

{% endcode %}

No parameters

### Delete Old Records

{% code lineNumbers="true" %}

```javascript
db.deleteOld({ ms:5, seconds:5, minutes:5, hours:5, days:0})
```

{% endcode %}

Requires at least one of the options below (multiple options will stack)

<table><thead><tr><th>Name</th><th>About</th><th>Type</th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>ms</td><td>Milliseconds</td><td>Number</td><td>false</td></tr><tr><td>seconds</td><td>Seconds</td><td>Number</td><td>false</td></tr><tr><td>minutes</td><td>Minutes</td><td>Number</td><td>false</td></tr><tr><td>hour</td><td>Hours</td><td>Number</td><td>false</td></tr><tr><td>days</td><td>Days</td><td>Number</td><td>false</td></tr></tbody></table>

### Delete Large Records

{% code lineNumbers="true" %}

```javascript
db.deleteLarge({ bytes:0, kilobytes:0, megabytes:0, gigabytes:0 })
```

{% endcode %}

Requires at least one of the options below (multiple options will stack)

<table><thead><tr><th>Name</th><th>About</th><th>Type</th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>options.bytes</td><td>Bytes</td><td>Number</td><td>false</td></tr><tr><td>options.kilobytes</td><td>Kilobytes</td><td>Number</td><td>false</td></tr><tr><td>options.megabytes</td><td>Megabytes</td><td>Number</td><td>false</td></tr><tr><td>options.gigabytes</td><td>Gigabytes</td><td>Number</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/2/manage.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.
