GetSystemEntityListCountWithHint
Get a count of system entities from the server base on where clause and hinting on index hint. Where clause allows entityType, createdAt, updatedAt, data items.
Service | Operation |
---|---|
globalEntity | GET_SYSTEM_ENTITY_LIST_COUNT_WITH_HINT |
Method Parameters
Parameter | Description |
---|---|
where | A mongo style query string. |
hintJson | The field index keys to be hinted, as JSON object. |
Usage
http://localhost:3000
- C#
- C++
- Objective-C
- Java
- JavaScript
- Dart
- Cloud Code
- Raw
string where = "{\"data.team\": \"Red\", \"data.position\": \"Forward\"}";
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.GetSystemEntityListCountWithHint(where, hintJson, successCallback, failureCallback);
const char *where = "{\"data.team\": \"Red\", \"data.position\": \"Forward\"}";
const char *hintJson = "{\"data.team\": 1, \"data.position\": 1}";
_bc.getGlobalentityService().getSystemEntityListCountWithHint(where, hintJson, this);
NSString *where = @"{\"data.team\": \"Red\", \"data.position\": \"Forward\"}";
NSString *hintJson = @"{\"data.team\": 1, \"data.position\": 1}";
BCCompletionBlock successBlock; // define callback
BCErrorCompletionBlock failureBlock; // define callback
[[_bc globalEntityService] GetSystemEntityListCountWithHint:
where:where
hintJson:hintJson
completionBlock:successBlock
errorCompletionBlock:failureBlock
cbObject:nil]
String where = "{\"data.team\": \"Red\", \"data.position\": \"Forward\"}";
String hintJson = "{\"data.team\": 1, \"data.position\": 1}";
this; // implements IServerCallback
_bc.getGlobalentityService.GetSystemEntityListCountWithHint(where, hintJson, this);
public void serverCallback(ServiceName serviceName, ServiceOperation serviceOperation, JSONObject jsonData)
{
System.out.print(String.format("Success | %s", jsonData.toString()));
}
public void serverError(ServiceName serviceName, ServiceOperation serviceOperation, int statusCode, int reasonCode, String jsonError)
{
System.out.print(String.format("Failed | %d %d %s", statusCode, reasonCode, jsonError.toString()));
}
var where = {
"data.team": "Red",
"data.position": "Forward"
};
var hintJson = {
"data.team": 1,
"data.position": 1
};
_bc.globalEntity.GetSystemEntityListCountWithHint(where, hintJson, result =>
{
var status = result.status;
console.log(status + " : " + JSON.stringify(result, null, 2));
});
var where = {
"data.team": "Red",
"data.position": "Forward"
};
var hintJson = {
"data.team": 1,
"data.position": 1
};
ServerResponse result = await _bc.globalEntityService.GetSystemEntityListCountWithHint(where:where, hintJson:hintJson);
if (result.statusCode == 200) {
print("Success");
} else {
print("Failed ${result.error['status_message'] ?? result.error}");
}
var where = {
"data.team": "Red",
"data.position": "Forward"
};
var hintJson = {
"data.team": 1,
"data.position": 1
};
var globalEntityProxy = bridge.getGlobalentityServiceProxy();
var postResult = globalEntityProxy.GetSystemEntityListCountWithHint(where, hintJson);
{
"service":"globalEntity",
"operation":"GET_SYSTEM_ENTITY_LIST_COUNT_WITH_HINT",
"data":{
"where":{
"data.team":"Red",
"data.position":"Forward"
},
"hintJson":{
"data.team":1,
"data.position":1
}
}
}
JSON Response
{
"status":200,
"data":
{
"entityListCount":5
}
}