diff --git a/source/examples/generated/kotlin/SchemaTest.snippet.inverse-relationship-user.kt b/source/examples/generated/kotlin/SchemaTest.snippet.inverse-relationship-user.kt index cd3fc81f434..ebe1ec5f54a 100644 --- a/source/examples/generated/kotlin/SchemaTest.snippet.inverse-relationship-user.kt +++ b/source/examples/generated/kotlin/SchemaTest.snippet.inverse-relationship-user.kt @@ -2,5 +2,5 @@ class User: RealmObject { @PrimaryKey var _id: ObjectId = ObjectId() var name: String = "" - var posts: RealmList? = realmListOf() + var posts: RealmList = realmListOf() } diff --git a/source/sdk/kotlin/realm-database/schemas/relationships.txt b/source/sdk/kotlin/realm-database/schemas/relationships.txt index 3fc396906d4..42cf7292f10 100644 --- a/source/sdk/kotlin/realm-database/schemas/relationships.txt +++ b/source/sdk/kotlin/realm-database/schemas/relationships.txt @@ -67,9 +67,12 @@ To-Many Relationship -------------------- A to-many relationship means that an object is related in a specific way -to multiple objects. You can create a relationship between one object +to multiple objects. + +You can create a relationship between one object and any number of objects using a field of type ``RealmList`` where -``T`` is a Realm object in your application: +``T`` is a Realm object in your application. Note that lists or sets of +``RealmObject`` cannot have null elements. .. literalinclude:: /examples/generated/kotlin/SchemaTest.snippet.to-many-relationship.kt :language: kotlin