I\'ve got several properties that should not be transferred to Firestore, such as metadata (\"id\" or \"parent\"), and with Firebase Realtime database, there was the option
For Kotlin you need to make sure that the getter is annotated with the @Exclude annotation and not just the appropriate field. You can do this by specifying the target of the annotation. For example:
data class Model(@get:Exclude val id: String)
@get specifies that the @Exclude annotation should be added to the value's getter. See Annotation Use-site Targets docs for more information.
This also works for data classes.
Credits to @mfulton26 for his answer https://stackoverflow.com/a/40117301/2739794.