Data Conversion in the SDK
This topic describes how the data formats used with key-value pairs are converted when the Kii Cloud SDK reads key-value pairs.
You can skip this topic if you are using only one platform (e.g. your application is only released for JavaScript) and if your application does not have any data format casting (e.g. all values written as "int" are read as "int").
Since the JSON format is based on the JavaScript object notation, the JavaScript data types are used in the JSON document without any change.
The SDK provides the dedicated getter and setter methods only for GeoPoint (geolocation). You can directly read and write all the other data types in the JSON document with the SDK.
The SDK will return values of the JSON data types. For example, the numeric data {"score":123}
will be returned as the numeric 123
. The string value {"score":"123"}
will be returned as a string "123"
.
The SDK returns undefined
if a specified key does not exist. It returns a null
if a null is stored in the JSON document.