BsonType

The different data types supported in BSON documents.

Note that the BSON type is available as the property code. The property ordinal is meaningless on this type, and may change over time.

External resources

Entries

Link copied to clipboard

A 64-bit floating-point number, represented by the Kotlin class kotlin.Double.

Link copied to clipboard

A UTF-8 encoded string, represented by the Kotlin class kotlin.String.

Link copied to clipboard

An arbitrary document, represented by the Kotlin interface Bson.

Link copied to clipboard

An array of arbitrary values, represented by the Kotlin interface BsonArray.

Link copied to clipboard

An arbitrary binary block.

Link copied to clipboard

The undefined value.

Link copied to clipboard

A 12-bytes, time-sorted unique identifier for documents, represented by the Kotlin class ObjectId.

Link copied to clipboard

A boolean value, represented by the Kotlin class kotlin.Boolean.

Link copied to clipboard

A date and time in UTC, represented by the Kotlin class kotlin.time.Instant.

Link copied to clipboard

The null value.

Link copied to clipboard

A MongoDB regular expression.

Link copied to clipboard

A reference to a document in another collection.

Link copied to clipboard

A string of JavaScript code.

Link copied to clipboard
Link copied to clipboard

A string of JavaScript code, accompanied by a document containing variables.

Link copied to clipboard

A 32-bit signed integer, represented by the Kotlin class kotlin.Int.

Link copied to clipboard

A special type used in MongoDB logs, represented by the Kotlin class Timestamp. In most situations, users should use Datetime instead.

Link copied to clipboard

A 64-bit signed integer, represented by the Kotlin class kotlin.Long.

Link copied to clipboard

A 128-bit floating-point number.

Link copied to clipboard

A special value containing the minimum possible value.

Link copied to clipboard

A special value containing the maximum possible value.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val code: Byte

The byte identifier for this particular type.

Link copied to clipboard

Returns a representation of an immutable list of all enum entries, in the order they're declared.

Link copied to clipboard
expect val name: String
Link copied to clipboard
expect val ordinal: Int

Functions

Link copied to clipboard
fun valueOf(value: String): BsonType

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Link copied to clipboard

Returns an array containing the constants of this enum type, in the order they're declared.