# 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`](https://db.coolstone.dev/browser/broken-reference) 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 %}
