Skip to content

MaxItems

class MaxItems(val size: Int, factory: BsonFactory) : Schema.SimpleConstraint<Collection<*>> 

The maximum number of items in an array (inclusive).

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

Constructors

MaxItems

constructor(size: Int, factory: BsonFactory)

Properties

name

val name: String

The name of this constraint.

size

val size: Int

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.