Loading TOC...

MarkLogic Server 11.0 Product Documentation
es.initInstance

es.initInstance(
   source-node as Item,
   entity-type-name as String
) as Object

Summary

This function is deprecated and will be removed in a future release.
A utility function used by generated code to initialize an instance data structure with data common across all entities of a given type, such as a type indicator.

Parameters
source-node The node to be initialized. This should be a source node of the form produced by es:init-source (XQuery) or es.initSource (JavaScript).
entity-type-name The entity type name expected by the caller.

Usage Notes

This function expects input in the form of a canonical instance, such as that produced by es.initSource You will not usually call this function directly in your application code. It is used in code generated by Entity Services, such as an instance converter module.

You usually will not call this function outside of code generated by Entity Services. The generated code uses this function to add properties such as the $type property and, if appropriate, $ref property to an instance. This enables your customizations of the generated code to be independent of instance properties used internally by Entity Servcies.

See Also

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.