GetEntitiesByType
Method returns all user entities that match the given type.
Service | Operation |
---|---|
entity | READ_BY_TYPE |
Method Parameters
Parameter | Description |
---|---|
entityType | The entity type to search for |
Usage
http://localhost:3000
- C#
- C++
- Objective-C
- Java
- JavaScript
- Dart
- Cloud Code
- Raw
string entityType = "someEntityType";
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.EntityService.GetEntitiesByType(entityType, successCallback, failureCallback);
const char *entityType = "someEntityType";
_bc->getEntityService()->getEntitiesByType(entityType, this);
NSString *entityType = @"someEntityType";
BCCompletionBlock successBlock; // define callback
BCErrorCompletionBlock failureBlock; // define callback
[[_bc entityService] getEntitiesByType:entityType
completionBlock:successBlock
errorCompletionBlock:failureBlock
cbObject:nil];
String entityType = "someEntityType";
this; // implements IServerCallback
_bc.getEntityService().getEntitiesByType(entityType, 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 = "someEntityType";
_bc.entity.getEntitiesByType(entityType, result =>
{
var status = result.status;
console.log(status + " : " + JSON.stringify(result, null, 2));
});
var entityType = "someEntityType";
ServerResponse result = await _bc.entityService.getEntitiesByType(entityType:entityType);
if (result.statusCode == 200) {
print("Success");
} else {
print("Failed ${result.error['status_message'] ?? result.error}");
}
var entityType = "someEntityType";
var entityProxy = bridge.getEntityServiceProxy();
var postResult = entityProxy.getEntitiesByType(entityType);
if (postResult.status == 200) {
// Success!
}
{
"service": "entity",
"operation": "READ_BY_TYPE",
"data": {
"entityType": "someEntityType"
}
}
JSON Response
{
"status": 200,
"data": {
"entities": [
{
"entityId": "96f77c80-4257-45ee-aed7-f1c6dd1ac44c",
"entityType": "address",
"version": 1,
"data": {
"street": "1309 Carling"
},
"acl": {
"other": 0
},
"createdAt": 1453926510649,
"updatedAt": 1453926510649
}
],
"_serverTime": 1637946319239
}
}