Serializer

Default serializer for ObjectId.

When serializing to BSON

ObjectId instances are encoded using MongoDB's native BsonType.ObjectId 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, ObjectId instances are represented as 24-characters hex strings.

Properties

Link copied to clipboard
open override val descriptor: SerialDescriptor

Functions

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