Skip to content

MaxLength

class MaxLength(val length: Int, factory: BsonFactory) : Schema.SimpleConstraint<String> 

This property must have a value with a length less than or equal to length.

If the property does not contain a string, this constraint is ignored.

Constructors

MaxLength

constructor(length: Int, factory: BsonFactory)

Properties

length

val length: Int

name

val name: String

The name of this constraint.

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.