ObjectIdSupport

zio.blocks.schema.bson.ObjectIdSupport

Provides Schema[ObjectId] support for BSON encoding/decoding.

The ObjectId is represented as a wrapper around String (hex representation), but when encoded to BSON, it uses the native BsonType.OBJECT_ID (12-byte format) via special handling in BsonCodecDeriver.

Attributes

Source
ObjectIdSupport.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Implicits

Implicits

implicit val objectIdSchema: Schema[ObjectId]

Schema for org.bson.types.ObjectId.

Schema for org.bson.types.ObjectId.

Manually constructed with typeId for "ObjectId" so BsonCodecDeriver can detect it and use zio-bson's native BsonCodec[ObjectId] (encodes as BsonType.OBJECT_ID).

Attributes

Source
ObjectIdSupport.scala