Class: Schema

diffusion.datatypes.RecordV2. Schema

new Schema()

Record schema.

A schema describes data content in terms of one or more record definitions. A record definition describes the layout of a record and comprises one or more field definitions.

Within the data content there can be multiple occurrences of a record or field described by a single definition. The defined (or allowed, when describing variable numbers) number of occurrences of each definition is referred to as its 'multiplicity'. The multiplicity can be fixed (the item occurs a fixed number of times), or variable (the item occurs from a minimum number of times to a maximum number of times). If a variable field is used it must be the last in a record definition and if a variable record is used it must be the last in the schema definition.

A field may be defined as of type 'string', 'integer' or 'decimal'. A decimal type has a further property of 'scale' which defines the number of digits to the right of the decimal point.

Since:
  • 6.0

Methods

asJSON() → {Object}

Returns the schema in a JSON format

Returns:

schema in JSON format

Type
Object

getRecords() → {Array.<diffusion.datatypes.RecordV2.Schema.Record>}

Returns an immutable, ordered list of record definitions.

There will be at least one.

Returns:

a list of the record definitions in the schema

Type
Array.<diffusion.datatypes.RecordV2.Schema.Record>