Serializer

Default serializer for Timestamp.

When serializing to BSON

Timestamp instances are encoded using MongoDB's native BsonType.Timestamp BSON type.

Supported drivers:

  • The official :bson-kotlinx serialization library.

  • The KtMongo Multiplatform driver.

When serializing to other formats

When serializing to other formats, like JSON, Timestamp instances are represented as a string that contains the instant in ISO 8601 format followed by a hash symbol (#) and the counter as a decimal number.

For example, 2022-02-32T12:58:01#32.

Properties

Link copied to clipboard
open override val descriptor: SerialDescriptor

Functions

Link copied to clipboard
open override fun deserialize(decoder: Decoder): Timestamp
Link copied to clipboard
open override fun serialize(encoder: Encoder, value: Timestamp)