SysDeleteEntities
Deletes all applicable custom entities from the server based on the custom entity type, specified delete criteria and acrossAllUsers flag, bypassing ownership/ACL checks.
Service | Operation |
---|---|
customEntity | SYS_DELETE_ENTITIES |
Method Parameters
Parameter | Description |
---|---|
entityType | The type of custom entity being deleted. |
deleteCriteria | The delete criteria to be applied. |
acrossAllUsers | Boolean indicating whether delete is to be applied to all users (true) or not (false), when custom entities are owned. |
Usage
http://localhost:3000
- C#
- C++
- Objective-C
- Java
- JavaScript
- Dart
- Cloud Code
- Raw
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
var entityType = "athletes";
var deleteCriteria = {
"entityId": { "$in":
["aaaa-bbbb-cccc-dddd", "ffff-gggg-hhhh-iiii", "jjjj-kkkk-llll-mmmm"]
}
};
var acrossAllUsers = true;
var customEntityProxy = bridge.getCustomEntityServiceProxy();
var postResult = customEntityProxy.sysDeleteEntities(entityType, deleteCriteria, acrossAllUsers);
if (postResult.status == 200) {
// Success!
}
//ownerId(s) is needed to specify for the owned custom entities only. Or, setting acrossAllUsers to true
{
"service": "customEntity",
"operation": "SYS_DELETE_ENTITIES",
"data": {
"entityType": "athletes",
"deleteCriteria": {
"entityId": { "$in":
["aaaa-bbbb-cccc-dddd", "ffff-gggg-hhhh-iiii", "jjjj-kkkk-llll-mmmm"]
},
"ownerId":"e7688d66-bf31-4d5c-a0f4-da97628531a3"//the ownerId is only needed for the owned custom entities. Or, set acrossAllUsers to true
},
"acrossAllUsers": false
}
}
JSON Response
{
"data": {
"deletedCount": 3
},
"status": 200
}