Skip to content

PatternProperties

class PatternProperties(val properties: Map<String, Schema<*>>, factory: BsonFactory) : Schema.SimpleConstraint<Any> 

The properties that must be present in an object, declared by pattern.

Each key of properties is a regular expression of the ECMA 262 dialect. Any field in the object that matches the pattern must have a value that follows the associated schema.

If this property does not contain an object, this constraint is ignored.

If the property AdditionalProperties is not present, this constraint is ignored.

Constructors

PatternProperties

constructor(properties: Map<String, Schema<*>>, factory: BsonFactory)

Properties

name

val name: String

The name of this constraint.

properties

Functions

toString

override fun toString(): String

JSON representation of this constraint object.

writeTo

override fun writeTo(writer: BsonFieldWriter)

Writes this object to the provided writer.