Skip to main content

Document

The Document class is the superclass of the Model class. Essentially a Document is a Model without any of the database access functionality of the Model class. A Document has a Schema but it does not have a Connection. Most consumers will never need to interact directly with a Document.

createDocumentFromRecordString Method

The Document class exposes a static method createDocumentFromRecordString. This factory method allows for creation of a Document instance from a string of delimited data representing a MultiValue record. The returned value from this method will be a Document instance which has formatted that delimited string according to the schema.

If you ever have a need to construct an object from an MVOM Schema that did not originate from a Model then this method will prove useful.

Syntax

static createDocumentFromRecordString(schema: Schema, recordString: string, dbServerDelimiters: object): Document

Parameters

ParameterTypeDescription
schemaSchemaAn instance of an MVOM schema
recordStringstringA string of data delimited with MultiValue attribute, value, and subvalue marks
dbServerDelimitersobjectAn object containing the characters which represent record, attribute, value, and subvalue marks in the delimited string

dbServerDelimiters Object

PropertyTypeDescription
rmstringThe character representing the record mark
amstringThe character representing the attribute mark
vmstringThe character representing the value mark
svmstringThe character representing the subvalue mark