es.extractionTemplateGenerate( model as Object ) as element(tde.template)
This function is deprecated and will not be supported in MarkLogic 11.
Generate a Template Driven Extraction (TDE) template you can use to
render entity instance data into rows for querying with the Optic API or
SQL.
Parameters | |
---|---|
model | A valid basic entity model. |
const es = require('/MarkLogic/entity-services/entity-services'); es.extractionTemplateGenerate( es.modelValidate( { "info": { "title": "Example", "version": "1.0.0", "description": "ES Examples" }, "definitions": { "Name": { "properties": { "first": { "datatype": "string" }, "middle": { "datatype": "string" }, "last": { "datatype": "string" } }, "required": [ "first", "last" ] }, "Person": { "properties": { "id": { "datatype": "int" }, "name": { "$ref": "#/definitions/Name" }, "bio": { "datatype": "string" }, "rating": { "datatype": "float" }, "phone": { "datatype": "array", "items": { "datatype": "string" } } }, "primaryKey": "id", "required": [ "id", "name" ] } } } )); // Result: A TDE template (XML) that defines how to express your entity // instances as rows.