Skip to content

AdditionalProperties

class AdditionalProperties(val schema: Schema<*>?, factory: BsonFactory) : Schema.SimpleConstraint<Any> 

Specifies the behavior of Properties and PatternProperties.

If this constraint is not present, any properties are allowed.

If this constraint is present and set to null, all properties must either:

  • Have a name present in Properties, and follow the associated schema.

  • Match a pattern present in PatternProperties, and follow the associated schema.

If this constraint is present and set to a schema, all properties must either:

  • Be valid according to rules of the null case.

  • Match the schema.

Constructors

AdditionalProperties

constructor(schema: Schema<*>?, factory: BsonFactory)

Properties

name

val name: String

The name of this constraint.

schema

val schema: Schema<*>?

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.