Skip to main content
Version: 5.7.0

GetListWithHint

Get a list of entities from the server base on where clause and hinting on indicated index hint. Where clause allows entityType, createdAt, updatedAt, data items.

ServiceOperation
globalEntityGET_LIST_WITH_HINT

Method Parameters

ParameterDescription
whereA mongo style query string.
orderBySpecifies the order in which the query returns matching documents. The sort parameter consists of a field followed by an ascending(1)/descending flag(-1). eg. { "name" : 1} sorts by name in ascending order.
maxReturnThe maximum number of entities to return.
hintJsonThe field index keys to be hinted, as JSON object.

Usage

http://localhost:3000
string where = "{\"data.team\": \"Red\", \"data.position\": \"Forward\"}";
string orderBy = "{}";
int maxReturn = 50;
string hintJson = "{\"data.team\": 1, \"data.position\": 1}";

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.GetListWithHint(where, orderBy, maxReturn, hintJson, successCallback, failureCallback);
JSON Response
{
"status": 200,
"data": {
"entityList": [
{
"gameId": "123456",
"entityId": "e919ffc2-c3f7-4cc0-a0f1-b3eb857c4ed0",
"ownerId": "7f416676-9e9d-422f-85b2-740185ac3139",
"entityType": "testGlobalEntity",
"entityIndexedId": null,
"version": 1,
"data": {
"globalTestName": "Test Name 01"
},
"acl": {
"other": 0
},
"expiresAt": 9223372036854775800,
"timeToLive": 0,
"createdAt": 1471010732135,
"updatedAt": 1471010732135
}
],
"_serverTime": 1637946319239,
"entityListCount": 1
}
}