Skip to content

ArrayItems

This property must have items following the specified configuration.

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

Constructors

ArrayItems

Types

ArrayItemsConfiguration

Heterogeneous

class Heterogeneous<T>(
    val items: List<Schema<T>>, 
    val additionalItems: Schema<T>?, 
    factory: BsonFactory
) : Schema.ArrayItems.ArrayItemsConfiguration<T> 

Pass this value to ArrayItems to specify that each item has its own schema.

Homogenous

Pass this value to ArrayItems to ensure that all items in an array conform to schema.

Properties

items

Specifies constraints on the items of the array.

Functions

toString

override fun toString(): String

JSON representation of this constraint object.

writeTo

@LowLevelApi
open override fun writeTo(writer: BsonFieldWriter)

Writes this object to the provided writer.