Field

interface Field(source)

A pair of a name and a value.

This type is used when iterating over the fields of a BsonDocument.

Equality & string representation

Different implementations of this interface are considered equal if:

The behavior of equals, hashCode and toString should be semantially equivalent to:

override fun equals(other: Any?): Boolean =
other is BsonDocument.Field && name == other.name && value == other.value

override fun hashCode(): Int =
name.hashCode() * 31 + value.hashCode()

override fun toString(): String =
"($name, $value)"

Different implementations are allowed only as performance improvements, but the output must be identical to the implementations provided above.

Properties

Link copied to clipboard
abstract val name: String
Link copied to clipboard
abstract val value: BsonValue

Functions

Link copied to clipboard
open operator fun component1(): String
Link copied to clipboard
open operator fun component2(): BsonValue