# Miscellaneous

## To String & JSON

{% code lineNumbers="true" %}

```javascript
db.get('tag').toString() // returns data as string
```

{% endcode %}

{% code lineNumbers="true" %}

```javascript
db.get('tag').toJSON() // returns data as an object, if possible
```

{% endcode %}

### Parameters

None

## End

If you want to *end* a string of methods, you can with `.end()`. It emits the [`end`](broken://pages/WBwFyPsLkvPcUSpCbZ9i) event and no methods can be added after it. **Note: this is not required.**

{% code lineNumbers="true" %}

```javascript
db.get("tag").overwrite(data).end()
```

{% endcode %}

## Exit&#x20;

If you wish to exit the Record editor API, call the `exit()` method and it will return the class.

{% code lineNumbers="true" %}

```javascript
db.get('tag').overwrite(data).exit().//any_class_function
```

{% endcode %}

## Something missing? <a href="#other" id="other"></a>

Use the `custom()` method to run a custom function without leaving the Record Editor API.

{% code lineNumbers="true" %}

```javascript
db.get('tag').custom(record => {
//do anything here
})
```

{% endcode %}

We also have a `custom()` method on the Dubnium class.

{% code lineNumbers="true" %}

```javascript
db.custom(db_class => {
//do anything here
})
```

{% endcode %}

Or if you wish to have it added to the API, [tell us](https://github.com/coolstone-tech/dubnium/discussions)!

## returnType

### About <a href="#returntype-about" id="returntype-about"></a>

Some functions have the `returnType` parameter. The values accepted are `1` and `2`.&#x20;

### 1 <a href="#returntype-1" id="returntype-1"></a>

Return as **JSON**.

### **2** <a href="#returntype-2" id="returntype-2"></a>

Return as an **Array**.

{% code lineNumbers="true" %}

```javascript
db.getAll(1) // will return all the records as an {JSON: 'object'}
db.getAll(2) // will return all the records as an [Array]
```

{% endcode %}


---

# 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/browser/miscellaneous.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.
