Skip to main content
Version: 5.7.0

GetRandomEntitiesMatching

Gets a list of up to randomCount randomly selected entities from the server based on the where condition and specified maximum return count.

ServiceOperation
globalEntityGET_RANDOM_ENTITIES_MATCHING

Method Parameters

ParameterDescription
whereMongo style query string.
maxReturnThe maximum number of entities to return.

Usage

http://localhost:3000
string where = "{\"entityType\": \"address\"}";
int maxReturn = 10;
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.GlobalEntityService.GetRandomEntitiesMatching(where, maxReturn, successCallback, failureCallback);
JSON Response
{
"data": {
"entityList": [
{
"gameId": "22459",
"entityId": "007ce17c-7bc0-4c4e-b08a-0f267517778a",
"ownerId": "ef26173d-a736-478c-aa00-5a5cea9962d1",
"entityType": "address",
"entityIndexedId": null,
"version": 1,
"data": {
"street": "1309 Carling"
},
"acl": {
"other": 1
},
"expiresAt": 9223372036854776000,
"timeToLive": null,
"createdAt": 1507580373566,
"updatedAt": 1507580373566
},
{
"gameId": "22459",
"entityId": "9bc36964-08e5-453c-ac71-142a3b66ca22",
"ownerId": "ef26173d-a736-478c-aa00-5a5cea9962d1",
"entityType": "address",
"entityIndexedId": null,
"version": 1,
"data": {
"street": "1309 Carling"
},
"acl": {
"other": 1
},
"expiresAt": 9223372036854776000,
"timeToLive": null,
"createdAt": 1507580372711,
"updatedAt": 1507580372711
}
],
"_serverTime": 1637946319239,
"entityListCount": 2
},
"status": 200
}