kmongo / org.litote.kmongo / Id

Id

interface Id<T> (source)

A unique document identifier.

If the id type need to support json serialization and deserialization, it must provide a toString() method and a constructor with a one String arg, and consistent equals & hashCode methods.

Please note that equals and hashCode methods of Id are "implementation dependant": if classes A and B are two implementations of Id, instances of A are always not equals to instances of B.

Parameters

T - the owner of the id

Extension Properties

idValue

val Any?.idValue: Any?

Returns the Mongo Id value (which can be null), or null if no id property is found.

json

val Any.json: String

Get the extended json representation of this object

Inheritors

StringId

data class StringId<T> : Id<T>

A String id.

WrappedObjectId

data class WrappedObjectId<T> : Id<T>

An Id containing a ObjectId.