Skip to content

Kotlin BSON • Multiplatform abstraction for different BSON implementationsopensavvy.ktmongo.bson.typesTimestampSerializer

Serializer

@LowLevelApi
class Serializer : KSerializer<Timestamp> 

Default serializer for Timestamp.

:bson-multiplatform and :bson-official both override this serializer. This serializer exists so that @Contextual is not required. It may also be used to convert the DTOs to other formats, like JSON.

Using this serializer, Timestamp is represented as a String with its Timestamp.instant and Timestamp.counter displayed. For example, 2022-02-32T12:58:01#32.

Avoid interacting with this type directly.

Constructors

Serializer

constructor()

Properties

descriptor

open override val descriptor: SerialDescriptor

Functions

deserialize

open override fun deserialize(decoder: Decoder): Timestamp

serialize

@LowLevelApi
open override fun serialize(encoder: Encoder, value: Timestamp)