Skip to main content
Version: 5.7.0

IncrementSingletonData

Increments the specified fields, of the singleton owned by the user, by the specified amount within the custom entity data on the server.

ServiceOperation
customEntityINCREMENT_SINGLETON_DATA

Method Parameters

ParameterDescription
entityTypeThe type of custom entity being updated.
fieldsJsonSpecific fields, as JSON, within entity's custom data, with respective increment amount.

Usage

http://localhost:3000
string entityType = "athletes";
string fieldsJson = "{ \"goals\": 3, \"assists\": 5 }";
SuccessCallback successCallback = (response, cbObject) =>
{
Debug.Log(string.Format("Success | {0}", response));
};
FailureCallback failureCallback = (status, code, error, cbObject) =>
{
Debug.Log(string.Format("Failed | {0} {1} {2}", status, code, error));
};

_bc.CustomEntityService.IncrementSingletonData(entityType, fieldsJson, successCallback, failureCallback);
JSON Response
{
"data": {
"timeToLive": null,
"createdAt": 1663079696618,
"data": {
"goals": 5,
"assists": 9
},
"entityType": "athletes",
"entityId": "aab8cc93-0f7b-4f42-9072-2437fc12737f",
"acl": {
"other": 1
},
"ownerId": "f5a6f67b-efa8-494f-b17e-d0f7f4b1e71e",
"version": 2,
"expiresAt": null,
"updatedAt": 1663079731601
},
"status": 200
}