> For the complete documentation index, see [llms.txt](https://simpldb.js.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://simpldb.js.org/v2.11.0/documentation/database/tojson.md).

# .toJSON()

Parses and returns all data from the database as an object.

### toJSON()

```javascript
db.toJSON(); // {}

db.set('colors', ['red', 'green', 'blue']);

db.toJSON(); // { colors: ['red', 'green', 'blue'] }
```
