GetCount
Counts the number of custom entities meeting the specified where clause.
Service | Operation |
---|---|
customEntity | GET_COUNT |
Method Parameters
Parameter | Description |
---|---|
entityType | The type of custom entity to be counted. |
whereJson | The where clause, as JSON object. |
Usage
http://localhost:3000
- C#
- C++
- Objective-C
- Java
- JavaScript
- Dart
- Cloud Code
- Raw
string entityType = "athletes";
string whereJson = "{\"data.position\":\"defense\"}";
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.GetCount(entityType, whereJson, successCallback, failureCallback);
const char *entityType = "athletes";
const char *whereJson = "{\"data.position\":\"defense\"}";
_bc->getCustomEntityService()->getCount(entityType, whereJson, this);
NSString *entityType = @"athletes";
NSString *whereJson = "{\"data.position\":\"defense\"}";
BCCompletionBlock successBlock; // define callback
BCErrorCompletionBlock failureBlock; // define callback
[[_bc customEntityService] getCount:entityType
whereJson:whereJson
completionBlock:successBlock
errorCompletionBlock:failureBlock
cbObject:nil];
String entityType = "athletes";
String whereJson = "{\"data.position\":\"defense\"}";
this; // implements IServerCallback
_bc.getCustomEntityService().getCount(entityType, whereJson, 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 entityType = "athletes";
var whereJson = {
"data.position": "defense"
};
_bc.customEntity.getCount(entityType, whereJson, result =>
{
var status = result.status;
console.log(status + " : " + JSON.stringify(result, null, 2));
});
var entityType = "athletes";
var whereJson = {
"data.position": "defense"
};
ServerResponse result = await _bc.customEntityService.getCount(entityType:entityType, whereJson:whereJson);
if (result.statusCode == 200) {
print("Success");
} else {
print("Failed ${result.error['status_message'] ?? result.error}");
}
var entityType = "athletes";
var whereJson = {
"data.position": "defense"
};
var customEntityProxy = bridge.getCustomEntityServiceProxy();
var postResult = customEntityProxy.getCount(entityType, whereJson);
if (postResult.status == 200) {
// Success!
}
{
"service": "customEntity",
"operation": "GET_COUNT",
"data": {
"entityType": "athletes",
"whereJson": {
"data.position": "defense"
}
}
}
JSON Response
{
"status": 200
"data": {
"entityListCount": 5
}
}