SysCreateCollection
Creates configuration for new custom entity collection.
Service | Operation |
---|---|
customEntity | SYS_CREATE_COLLECTION |
Method Parameters
Parameter | Description |
---|---|
entityType | The type of custom entity collection to be created. |
collectionOptsJson | The collection options, as JSON object. |
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 collectionOptsJson = {
"isOwned": false,
"migrate": true,
"identifier": "playerName",
"dataTemplateJson": {
"playerName": "Randy Traywick",
"playerId": 123456,
"teamName": "Super Stars",
"jerseyNum": 44
},
"dataTemplateText": "**Important** notes go here..."
};
var customEntityProxy = bridge.getCustomEntityServiceProxy();
var postResult = customEntityProxy.sysCreateCollection(entityType, collectionOptsJson);
if (postResult.status == 200) {
// Success!
}
{
"service": "customEntity",
"operation": "SYS_CREATE_COLLECTION",
"data": {
"entityType": "athletes",
"collectionOptsJson": {
"isOwned": false,
"migrate": true,
"identifier": "playerName",
"dataTemplateJson": {
"playerName": "Randy Traywick",
"playerId": 123456,
"teamName": "Super Stars",
"jerseyNum": 44
},
"dataTemplateText": "**Important** notes go here..."
}
}
}
JSON Response
{
"data": {
"collection": {
"options": {
"isOwned": false,
"migrate": true,
"identifier": "playerName",
"dataTemplateJson": {
"playerName": "Randy Traywick",
"playerId": 123456,
"teamName": "Super Stars",
"jerseyNum": 44
},
"dataTemplateText": "**Important** notes go here..."
},
"name": "athletes",
"customIndexes": {}
}
},
"status": 200
}