Home | Platform SDK

Data

These methods are accessible through env.data(), profile.data() and wallet.data() which expose a DataRepository instance.

Get a list of all stored data

profile.data().all();

Get the first stored data item

profile.data().first();

Get the last stored data item

profile.data().last();

Get a list of all stored data keys

profile.data().keys();

Get a list of all data values

profile.data().values();

Get the value for the given key

profile.data().get("theme");

Fill the data with the provided key-value pairs

profile.data().fill(profileData);

Check if a data for the given key exists

profile.data().has("theme");

Check if a data for the given key is missing

profile.data().missing("theme");

Forget the value for the given key

profile.data().forget("theme");

Forget the value for the given key and index

profile.data().forgetIndex("theme", 1);

Forget all data (Use with caution!)

profile.data().flush();

Get the count of the stored data

profile.data().count();

Take a snapshot of the current data (Use with caution!)

profile.data().snapshot();

Restore a previously taken snapshot (Use with caution!)

profile.data().restore();

Return the data as a JSON object

profile.data().toJson();
2021 © ARK.io | All rights reserved An ARK.io Product