ModelSchema
Describes the schema of an Insight model.
Example
// to fetch a ModelSchema from a app var entity = insight .getView() .getApp() .getModelSchema(); // to fetch a ModelSchema from a scenario instance var entity = scenario .getModelSchema();
Method summary
name | description |
---|---|
findArraysIndexedBy | Finds the names of all array entities that are indexed by the given list of entity names. |
getAllEntities | All the entities in this schema. |
getAppId | The app id of this model schema. |
getEntity | Gets an entity by name. |
getProjectId | Use ModelSchema#getAppId instead. |
Methods
- findArraysIndexedBy ( entityNames ) → {Array.<object>}
-
Finds all array entities that are indexed by the given list of entity names.
The match is exact and the order of the index names is significant.Parameters:
paramsName Type Description entityNames typeArray.<string>the list of entity names expected in the index set detailsReturns:returns tableType Description typeArray.<object>The array of entities that are indexed by the required index sets, empty if none are found Example
examples
Back to Topvar entityNameList = modelSchema.findArraysIndexedBy(['INDEX_SET1', 'INDEX_SET2']);
- getAllEntities ( ) → {Object.<string, ModelEntity>}
-
All the entities in this schema.
detailsReturns:returns tableType Description typeObject.<string, ModelEntity>an array of all the entities in this schema Example
examples
Back to Topvar allEntities = modelSchema.getAllEntities();
- getAppId ( ) → {string}
-
The app id of this model schema.
detailsReturns:returns tableType Description typestringThe app id of this model schema Example
examples
Back to TopmodelSchema.getAppId();
- getEntity ( entityName ) → {ModelEntity}
-
Gets an entity by name.
Parameters:
paramsName Type Description entityName typestringthe name of the entity detailsReturns:returns tableType Description typeModelEntitythe entity or undefined if no entity exists with that name Example
examples
Back to Topvar entity = modelSchema.getEntity('ENTITY_NAME');
- getProjectId ( )
-
Use ModelSchema#getAppId instead.
details- Deprecated since Js Api 4.5
method
method
method
method
method