PrimaryKey

@Target(allowedTargets = [AnnotationTarget.FIELD])
annotation class PrimaryKey

Annotation marking a field as a primary key inside Realm.

Only one field in a RealmObject class can have this annotation, and the field should uniquely identify the object.

This annotation applies to the following primitive types: String, Byte, Char, Short, Int, Long, io.realm.kotlin.types.ObjectId, org.mongodb.kbson.ObjectId and RealmUUID, as well as their nullable variants.

It cannot be applied on a property that also has a FullText annotation.