TinyBase logoTinyBase


The getJson method returns a string serialization of all the Store content: both the Tables and the keyed Values.

getJson(): string

A string serialization of the Tables and Values in the Store.

From v3.0.0 onwards, the serialization is of an array with two entries. The first is the Tables object, the second the Values. In previous versions (before the existence of the Values data structure), it was a sole object of Tables.


This example serializes the tabular and keyed value contents of a Store.

const store = createStore()
  .setTables({pets: {fido: {species: 'dog'}}})
  .setValues({open: true});
// -> '[{"pets":{"fido":{"species":"dog"}}},{"open":true}]'

This example serializes the contents of an empty Store.

const store = createStore();
// -> '[{},{}]'