From 94d672581916ef7b666c415d852fa80a595b5132 Mon Sep 17 00:00:00 2001 From: dacharyc Date: Thu, 6 Jun 2024 12:56:32 -0400 Subject: [PATCH 1/4] Draft a consolidated relationships page --- ...ships-inverse-relationship-description.rst | 7 + ...ships-inverse-relationship-description.rst | 18 ++ ...ships-inverse-relationship-description.rst | 6 + ...ships-inverse-relationship-description.rst | 9 + ...ships-inverse-relationship-description.rst | 28 +++ ...ships-inverse-relationship-description.rst | 13 ++ ...ships-inverse-relationship-description.rst | 7 + ...ships-inverse-relationship-description.rst | 4 + ...ships-inverse-relationship-description.rst | 28 +++ ...-to-one-relationships-must-be-optional.rst | 5 - .../relationships-inverse-relationship.rst | 61 +++++++ .../relationships-to-many-relationship.rst | 61 +++++++ .../relationships-to-one-relationship.rst | 61 +++++++ source/sdk/model-data/relationships.txt | 167 +++++++++++++++++- 14 files changed, 469 insertions(+), 6 deletions(-) create mode 100644 source/includes/api-details/cpp/model-data/relationships-inverse-relationship-description.rst create mode 100644 source/includes/api-details/csharp/model-data/relationships-inverse-relationship-description.rst create mode 100644 source/includes/api-details/dart/model-data/relationships-inverse-relationship-description.rst create mode 100644 source/includes/api-details/java/model-data/relationships-inverse-relationship-description.rst create mode 100644 source/includes/api-details/javascript/model-data/relationships-inverse-relationship-description.rst create mode 100644 source/includes/api-details/kotlin/model-data/relationships-inverse-relationship-description.rst create mode 100644 source/includes/api-details/objectivec/model-data/relationships-inverse-relationship-description.rst create mode 100644 source/includes/api-details/swift/model-data/relationships-inverse-relationship-description.rst create mode 100644 source/includes/api-details/typescript/model-data/relationships-inverse-relationship-description.rst delete mode 100644 source/includes/note-to-one-relationships-must-be-optional.rst create mode 100644 source/includes/sdk-examples/model-data/relationships-inverse-relationship.rst create mode 100644 source/includes/sdk-examples/model-data/relationships-to-many-relationship.rst create mode 100644 source/includes/sdk-examples/model-data/relationships-to-one-relationship.rst diff --git a/source/includes/api-details/cpp/model-data/relationships-inverse-relationship-description.rst b/source/includes/api-details/cpp/model-data/relationships-inverse-relationship-description.rst new file mode 100644 index 0000000000..d12183025f --- /dev/null +++ b/source/includes/api-details/cpp/model-data/relationships-inverse-relationship-description.rst @@ -0,0 +1,7 @@ +To define an inverse relationship, use ``linking_objects`` in your object +model. The ``linking_objects`` definition specifies the object type and +property name of the relationship that it inverts. + +In this example, we define a ``Person`` having a to-one relationship with +a ``Dog``. The ``Dog`` has an inverse relationship to any ``Person`` +objects through its ``owners`` property. diff --git a/source/includes/api-details/csharp/model-data/relationships-inverse-relationship-description.rst b/source/includes/api-details/csharp/model-data/relationships-inverse-relationship-description.rst new file mode 100644 index 0000000000..f328da6544 --- /dev/null +++ b/source/includes/api-details/csharp/model-data/relationships-inverse-relationship-description.rst @@ -0,0 +1,18 @@ +To define the inverse relationship, define a getter-only ``IQueryable`` +property in your object model, where ``T`` is the source type of the +relationship. Then, annotate this property with a +:dotnet-sdk:`[Backlink(sourceProperty)] ` +attribute, where "sourceProperty" is the name of the property on the other +side of the relationship. The following example shows how to do this with the +"User has many Items" scenario. + +In this example, note that: + +- The Item object's ``Assignee`` property is a ``User`` object. + +- The ``User`` object's ``Items`` property inverts the relationship and + refers to all ``Item`` objects that contain this specific ``User`` in their + ``Assignee`` property. + +This, then, allows us to query the ``Item`` collection to get all ``Items`` +assigned to a specific ``User``. diff --git a/source/includes/api-details/dart/model-data/relationships-inverse-relationship-description.rst b/source/includes/api-details/dart/model-data/relationships-inverse-relationship-description.rst new file mode 100644 index 0000000000..a5ecc83f9b --- /dev/null +++ b/source/includes/api-details/dart/model-data/relationships-inverse-relationship-description.rst @@ -0,0 +1,6 @@ +Use the `Backlink `__ +property annotation to define an inverse relationship. +Pass a `Symbol `__ +of the field name of the to-one or to-many field for which you are creating the +backlink as an argument to ``Backlink()``. Include an ``Iterable`` of the +object model you are backlinking to in the field below the annotation. diff --git a/source/includes/api-details/java/model-data/relationships-inverse-relationship-description.rst b/source/includes/api-details/java/model-data/relationships-inverse-relationship-description.rst new file mode 100644 index 0000000000..41b31e2dda --- /dev/null +++ b/source/includes/api-details/java/model-data/relationships-inverse-relationship-description.rst @@ -0,0 +1,9 @@ +To define an inverse relationship, define a ``LinkingObjects`` property in your +object model. The ``LinkingObjects`` definition specifies the object type and +property name of the relationship that it inverts. + +Fields annotated with ``@LinkingObjects`` must be: + +- marked ``final`` +- of type ``RealmResults`` where ``T`` is the type at the opposite + end of the relationship diff --git a/source/includes/api-details/javascript/model-data/relationships-inverse-relationship-description.rst b/source/includes/api-details/javascript/model-data/relationships-inverse-relationship-description.rst new file mode 100644 index 0000000000..dde15adfd2 --- /dev/null +++ b/source/includes/api-details/javascript/model-data/relationships-inverse-relationship-description.rst @@ -0,0 +1,28 @@ +To define an inverse relationship, define a ``linkingObjects`` property in your +object model. ``linkingObjects`` specifies the object type and +property name of the relationship that it inverts. + +.. literalinclude:: /examples/generated/node/v12/relationships.test.snippet.define-inverse.js + :language: javascript + +**Dynamically Obtain an Inversely Linked Object** + +You can dynamically retrieve an object with an inverse relationship without +defining a ``linkingObjects`` type in its schema. Remove the +``linkingObjects`` type from your schema, so your schemas look like a standard +**to-many** relationship. When you need to retrieve the linked object, call the +:js-sdk:`Realm.Object.linkingObjects() ` +query. + +In the following continuation from the inverse relationship example, we +have removed the ``manufacturer`` field with type 'linkingObjects' from +the ``Car`` schema. An application developer creates several manufacturers +and car objects, and the application pushes the newly-created cars into a +manufacturer's ``cars`` field. + +To find the manufacturer who makes a specific car object, call ``.linkingObjects()`` +and pass the "Manufacturer" class name and "cars" field as parameters. + +The ``.linkingObjects()`` method returns a Results collection of objects whose +property inverts the relationship. In this example, only one manufacturer makes +the Sentra car model, so we can expect that manufacturer to be named Nissan. diff --git a/source/includes/api-details/kotlin/model-data/relationships-inverse-relationship-description.rst b/source/includes/api-details/kotlin/model-data/relationships-inverse-relationship-description.rst new file mode 100644 index 0000000000..200cff2bf6 --- /dev/null +++ b/source/includes/api-details/kotlin/model-data/relationships-inverse-relationship-description.rst @@ -0,0 +1,13 @@ +To define an inverse relationship between objects, first define a +collection property in the parent object whose type is a +``RealmList``, ``RealmSet``, or ``RealmDictionary``, where +```` is a ``RealmObject`` object type defined in your data model. +This can be a different Realm object type or the same Realm object +type: + +.. literalinclude:: /examples/generated/kotlin/Schema.snippet.define-inverse-property-parent.kt + :language: kotlin + +Then, define an immutable :kotlin-sdk:`backlinks +` property in the child object of +``RealmResults``, where ```` is the parent object type: diff --git a/source/includes/api-details/objectivec/model-data/relationships-inverse-relationship-description.rst b/source/includes/api-details/objectivec/model-data/relationships-inverse-relationship-description.rst new file mode 100644 index 0000000000..9b7ecfcc47 --- /dev/null +++ b/source/includes/api-details/objectivec/model-data/relationships-inverse-relationship-description.rst @@ -0,0 +1,7 @@ +To define an inverse relationship, use +:objc-sdk:`RLMLinkingObjects +` in your object model. +Override :objc-sdk:`+[RLMObject linkingObjectProperties] +` +method in your class to specify the object type and property name +of the relationship that it inverts. diff --git a/source/includes/api-details/swift/model-data/relationships-inverse-relationship-description.rst b/source/includes/api-details/swift/model-data/relationships-inverse-relationship-description.rst new file mode 100644 index 0000000000..2fead0a5ae --- /dev/null +++ b/source/includes/api-details/swift/model-data/relationships-inverse-relationship-description.rst @@ -0,0 +1,4 @@ +To define an inverse relationship, use :swift-sdk:`LinkingObjects +` in your object model. The +``LinkingObjects`` definition specifies the object type and +property name of the relationship that it inverts. diff --git a/source/includes/api-details/typescript/model-data/relationships-inverse-relationship-description.rst b/source/includes/api-details/typescript/model-data/relationships-inverse-relationship-description.rst new file mode 100644 index 0000000000..c7c6739a7e --- /dev/null +++ b/source/includes/api-details/typescript/model-data/relationships-inverse-relationship-description.rst @@ -0,0 +1,28 @@ +To define an inverse relationship, define a ``linkingObjects`` property in your +object model. ``linkingObjects`` specifies the object type and +property name of the relationship that it inverts. + +.. literalinclude:: /examples/generated/node/v12/relationships.test.snippet.define-inverse.ts + :language: typescript + +**Dynamically Obtain an Inversely Linked Object** + +You can dynamically retrieve an object with an inverse relationship without +defining a ``linkingObjects`` type in its schema. Remove the +``linkingObjects`` type from your schema, so your schemas look like a standard +**to-many** relationship. When you need to retrieve the linked object, call the +:js-sdk:`Realm.Object.linkingObjects() ` +query. + +In the following continuation from the inverse relationship example, we +have removed the ``manufacturer`` field with type 'linkingObjects' from +the ``Car`` schema. An application developer creates several manufacturers +and car objects, and the application pushes the newly-created cars into a +manufacturer's ``cars`` field. + +To find the manufacturer who makes a specific car object, call ``.linkingObjects()`` +and pass the "Manufacturer" class name and "cars" field as parameters. + +The ``.linkingObjects()`` method returns a Results collection of objects whose +property inverts the relationship. In this example, only one manufacturer makes +the Sentra car model, so we can expect that manufacturer to be named Nissan. diff --git a/source/includes/note-to-one-relationships-must-be-optional.rst b/source/includes/note-to-one-relationships-must-be-optional.rst deleted file mode 100644 index c83b692a6b..0000000000 --- a/source/includes/note-to-one-relationships-must-be-optional.rst +++ /dev/null @@ -1,5 +0,0 @@ -.. important:: To-one relationships must be optional - - When you declare a to-one relationship in your object model, it must - be an optional property. If you try to make a to-one relationship - required, Realm throws an exception at runtime. \ No newline at end of file diff --git a/source/includes/sdk-examples/model-data/relationships-inverse-relationship.rst b/source/includes/sdk-examples/model-data/relationships-inverse-relationship.rst new file mode 100644 index 0000000000..d96f15593d --- /dev/null +++ b/source/includes/sdk-examples/model-data/relationships-inverse-relationship.rst @@ -0,0 +1,61 @@ +.. tabs-drivers:: + + tabs: + - id: cpp-sdk + content: | + + .. literalinclude:: /examples/generated/cpp/relationships.snippet.define-inverse-relationship.cpp + :language: cpp + :emphasize-lines: 13 + + - id: csharp + content: | + + .. literalinclude:: /examples/generated/dotnet/Relationships.snippet.inverse.cs + :language: csharp + + - id: dart + content: | + + .. literalinclude:: /examples/generated/flutter/backlinks_test.snippet.backlink-models.dart + :language: dart + + - id: java + content: | + + .. include:: /examples/generated/java/local/FrogInverseRelationshipExample.snippet.complete.java.rst + + - id: java-kotlin + content: | + + .. include:: /examples/generated/java/local/FrogInverseRelationshipExampleKt.snippet.complete.kt.rst + + - id: javascript + content: | + + .. literalinclude:: /examples/generated/node/v12/relationships.test.snippet.obtain-inverse-relationship-dynamically.js + :language: javascript + + - id: kotlin + content: | + + .. literalinclude:: /examples/generated/kotlin/Schema.snippet.define-inverse-property-child.kt + :language: kotlin + + - id: objectivec + content: | + + .. literalinclude:: /examples/generated/code/start/Relationships.snippet.inverse-relationship.m + :language: objectivec + + - id: swift + content: | + + .. literalinclude:: /examples/generated/code/start/Relationships.snippet.inverse-relationship.swift + :language: swift + + - id: typescript + content: | + + .. literalinclude:: /examples/generated/node/v12/relationships.test.snippet.obtain-inverse-relationship-dynamically.ts + :language: typescript diff --git a/source/includes/sdk-examples/model-data/relationships-to-many-relationship.rst b/source/includes/sdk-examples/model-data/relationships-to-many-relationship.rst new file mode 100644 index 0000000000..161fbedc01 --- /dev/null +++ b/source/includes/sdk-examples/model-data/relationships-to-many-relationship.rst @@ -0,0 +1,61 @@ +.. tabs-drivers:: + + tabs: + - id: cpp-sdk + content: | + + .. literalinclude:: /examples/generated/cpp/relationships.snippet.to-many-relationship.cpp + :language: cpp + :emphasize-lines: 7 + + - id: csharp + content: | + + .. literalinclude:: /examples/generated/dotnet/Relationships.snippet.one-to-many.cs + :language: csharp + + - id: dart + content: | + + .. literalinclude:: /examples/generated/flutter/schemas.snippet.many-to-many-models.dart + :language: dart + + - id: java + content: | + + .. include:: /examples/generated/java/local/FrogManyToManyExample.snippet.complete.java.rst + + - id: java-kotlin + content: | + + .. include:: /examples/generated/java/local/FrogManyToManyExampleKt.snippet.complete.kt.rst + + - id: javascript + content: | + + .. literalinclude:: /examples/generated/node/v12/relationships.test.snippet.define-one-to-many.js + :language: javascript + + - id: kotlin + content: | + + .. literalinclude:: /examples/generated/kotlin/Schema.snippet.define-to-many-relationship.kt + :language: kotlin + + - id: objectivec + content: | + + .. literalinclude:: /examples/generated/code/start/Relationships.snippet.to-many-relationship.m + :language: objectivec + + - id: swift + content: | + + .. literalinclude:: /examples/generated/code/start/Relationships.snippet.to-many-relationship.swift + :language: swift + + - id: typescript + content: | + + .. literalinclude:: /examples/generated/node/v12/relationships.test.snippet.define-one-to-many.ts + :language: typescript diff --git a/source/includes/sdk-examples/model-data/relationships-to-one-relationship.rst b/source/includes/sdk-examples/model-data/relationships-to-one-relationship.rst new file mode 100644 index 0000000000..0e4445e1f4 --- /dev/null +++ b/source/includes/sdk-examples/model-data/relationships-to-one-relationship.rst @@ -0,0 +1,61 @@ +.. tabs-drivers:: + + tabs: + - id: cpp-sdk + content: | + + .. literalinclude:: /examples/generated/cpp/relationships.snippet.to-one-relationship.cpp + :language: cpp + :emphasize-lines: 13 + + - id: csharp + content: | + + .. literalinclude:: /examples/generated/dotnet/Relationships.snippet.one-to-one.cs + :language: csharp + + - id: dart + content: | + + .. literalinclude:: /examples/generated/flutter/schemas.snippet.many-to-one-models.dart + :language: dart + + - id: java + content: | + + .. include:: /examples/generated/java/local/FrogManyToOneExample.snippet.complete.java.rst + + - id: java-kotlin + content: | + + .. include:: /examples/generated/java/local/FrogManyToOneExampleKt.snippet.complete.kt.rst + + - id: javascript + content: | + + .. literalinclude:: /examples/generated/node/v12/relationships.test.snippet.define-one-to-one.js + :language: javascript + + - id: kotlin + content: | + + .. literalinclude:: /examples/generated/kotlin/Schema.snippet.define-to-one-relationship.kt + :language: kotlin + + - id: objectivec + content: | + + .. literalinclude:: /examples/generated/code/start/Relationships.snippet.to-one-relationship.m + :language: objectivec + + - id: swift + content: | + + .. literalinclude:: /examples/generated/code/start/Relationships.snippet.to-one-relationship.swift + :language: swift + + - id: typescript + content: | + + .. literalinclude:: /examples/generated/node/v12/relationships.test.snippet.define-one-to-one.ts + :language: typescript diff --git a/source/sdk/model-data/relationships.txt b/source/sdk/model-data/relationships.txt index 94ab2460f7..795e74cfe7 100644 --- a/source/sdk/model-data/relationships.txt +++ b/source/sdk/model-data/relationships.txt @@ -4,10 +4,175 @@ Model Relationships =================== +.. meta:: + :description: Learn how Atlas Device SDK uses relationships to reference other database objects, and how to define relationships in your code. + :keywords: Realm, C++ SDK, Flutter SDK, Kotlin SDK, Java SDK, .NET SDK, Node.js SDK, Swift SDK, code example + +.. facet:: + :name: genre + :values: reference + +.. facet:: + :name: programming_language + :values: cpp, csharp, dart, java, javascript/typescript, kotlin, objective-c, swift + .. contents:: On this page :local: :backlinks: none :depth: 3 :class: singlecol -Placeholder page for modeling relationships in the SDKs. \ No newline at end of file +.. tabs-selector:: drivers + +This page describes how to define relationships between objects in your data +model. To learn about SDK objects and how to define them, refer to +:ref:`sdks-object-models`. + +Atlas Device SDK uses explicit relationships between the types of +objects in an App. A relationship is an object property that references +another SDK object rather than one of the primitive data types. You +define relationships by setting the type of an object property to +another object type in the object model or object schema. + +Relationships are direct references to other objects in a database, which +means that you don't need bridge tables or explicit joins to define a +relationship like you would in a relational database. Instead you can +access related objects by reading and writing to the property that +defines the relationship. The SDK executes read operations lazily as they +come in, so querying a relationship is just as performant as reading a regular +property. + +Relationship Types +------------------ + +The SDK supports **to-one**, **to-many**, and **inverse** +relationships. The SDK also provides a special type of object, called an +:ref:`embedded object `, that is conceptually +similar to a relationship but provides additional constraints. + +The SDK *does not* inherently limit object references from other +objects within the same database. This means that SDK relationships are +implicitly "many-to-one" or "many-to-many." The only way to restrict a +relationship to "one to one/one to many" instead of "many to one/many +to many" is to use an :ref:`embedded object `, +which is a nested object with exactly one parent. + +.. _sdks-to-one-relationship: + +To-One Relationship +~~~~~~~~~~~~~~~~~~~ + +A **to-one** relationship maps one property in an object model to a single +instance of another object type. For example, a dog might have a to-one +relationship with a favorite toy. + +Setting a relationship field to null removes the connection between objects. +The SDK does not delete the referenced object, though, unless it is +:ref:`an embedded object `. + +.. important:: To-one relationships must be optional + + When you declare a to-one relationship in your object model, it must + be an optional property. If you try to make a to-one relationship + required, the SDK throws an exception at runtime. + +.. include:: /includes/sdk-examples/model-data/relationships-to-one-relationship.rst + +.. _sdks-to-many-relationship: + +To-Many Relationship +~~~~~~~~~~~~~~~~~~~~ + +A **to-many** relationship means that an object relates to more than one +other object. In Atlas Device SDK, a to-many relationship is a list of +references to other objects. For example, a person might have many dogs. + +You can represent a to-many relationship between two SDK types as a list, map, +or a set. Lists, maps, and sets are mutable: within a write transaction, you +can add and remove elements to and from these collection types. Lists, maps, +and sets are not associated with a query and are declared as a property of the +object model. + +.. include:: /includes/sdk-examples/model-data/relationships-to-many-relationship.rst + +.. _cpp-inverse-relationship: + +Inverse Relationship +~~~~~~~~~~~~~~~~~~~~ + +Relationship definitions in Realm are unidirectional. An +**inverse relationship** links an object back to an object +that refers to it. + +An inverse relationship property is an automatic **backlink** relationship. +The SDK automatically updates implicit relationships whenever an object is +added or removed in the specified relationship. You cannot manually set the +value of an inverse relationship property. + +Since relationships are many-to-one or many-to-many, following inverse +relationships can result in zero, one, or many objects. + +.. tabs-drivers:: + + .. tab:: + :tabid: cpp-sdk + + .. include:: /includes/api-details/cpp/model-data/relationships-inverse-relationship-description.rst + + .. tab:: + :tabid: csharp + + .. include:: /includes/api-details/csharp/model-data/relationships-inverse-relationship-description.rst + + .. tab:: + :tabid: dart + + .. include:: /includes/api-details/dart/model-data/relationships-inverse-relationship-description.rst + + .. tab:: + :tabid: java + + .. include:: /includes/api-details/java/model-data/relationships-inverse-relationship-description.rst + + .. tab:: + :tabid: java-kotlin + + .. include:: /includes/api-details/java/model-data/relationships-inverse-relationship-description.rst + + .. tab:: + :tabid: javascript + + .. include:: /includes/api-details/javascript/model-data/relationships-inverse-relationship-description.rst + + .. tab:: + :tabid: kotlin + + .. include:: /includes/api-details/kotlin/model-data/relationships-inverse-relationship-description.rst + + .. tab:: + :tabid: objectivec + + .. include:: /includes/api-details/objectivec/model-data/relationships-inverse-relationship-description.rst + + .. tab:: + :tabid: swift + + .. include:: /includes/api-details/swift/model-data/relationships-inverse-relationship-description.rst + + .. tab:: + :tabid: typescript + + .. include:: /includes/api-details/typescript/model-data/relationships-inverse-relationship-description.rst + +.. include:: /includes/sdk-examples/model-data/relationships-inverse-relationship.rst + +.. note:: Inverse Relationships Not Present in Device Sync Schema + + If you are using Atlas Device Sync, inverse relationships are not present + in the server-side Device Sync schema in your App Services App. + Since you can't directly set the value of an inverse relationship, + the relationship does not exist in Device Sync schema. + + For more information on the server-side Device Sync schema, + refer to :ref:`Configure and Update Your Data Model ` + in the Atlas App Services documentation. From f5ffe46af92c584f948d967f4b47102b774601a9 Mon Sep 17 00:00:00 2001 From: dacharyc Date: Thu, 6 Jun 2024 13:57:45 -0400 Subject: [PATCH 2/4] Fix snooty build error --- source/sdk/model-data/relationships.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/sdk/model-data/relationships.txt b/source/sdk/model-data/relationships.txt index 795e74cfe7..e44fea1d41 100644 --- a/source/sdk/model-data/relationships.txt +++ b/source/sdk/model-data/relationships.txt @@ -47,7 +47,7 @@ Relationship Types The SDK supports **to-one**, **to-many**, and **inverse** relationships. The SDK also provides a special type of object, called an -:ref:`embedded object `, that is conceptually +:ref:`embedded object `, that is conceptually similar to a relationship but provides additional constraints. The SDK *does not* inherently limit object references from other From f2bed5078a57829d0e927d0acdcd93511ccde713 Mon Sep 17 00:00:00 2001 From: dacharyc Date: Thu, 6 Jun 2024 14:03:26 -0400 Subject: [PATCH 3/4] Fix snooty build error --- source/sdk/model-data/relationships.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/sdk/model-data/relationships.txt b/source/sdk/model-data/relationships.txt index e44fea1d41..90fab3a333 100644 --- a/source/sdk/model-data/relationships.txt +++ b/source/sdk/model-data/relationships.txt @@ -47,7 +47,7 @@ Relationship Types The SDK supports **to-one**, **to-many**, and **inverse** relationships. The SDK also provides a special type of object, called an -:ref:`embedded object `, that is conceptually +:ref:`embedded object `, that is conceptually similar to a relationship but provides additional constraints. The SDK *does not* inherently limit object references from other From 5668d2eab0fd48c3ac8e3c64a40636a8361393ac Mon Sep 17 00:00:00 2001 From: dacharyc Date: Fri, 21 Jun 2024 16:53:54 -0400 Subject: [PATCH 4/4] Apply review suggestions --- source/sdk/model-data/relationships.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/sdk/model-data/relationships.txt b/source/sdk/model-data/relationships.txt index 90fab3a333..557bc6b92c 100644 --- a/source/sdk/model-data/relationships.txt +++ b/source/sdk/model-data/relationships.txt @@ -54,8 +54,8 @@ The SDK *does not* inherently limit object references from other objects within the same database. This means that SDK relationships are implicitly "many-to-one" or "many-to-many." The only way to restrict a relationship to "one to one/one to many" instead of "many to one/many -to many" is to use an :ref:`embedded object `, -which is a nested object with exactly one parent. +to many" is to use an embedded object, which is a nested object with exactly +one parent. .. _sdks-to-one-relationship: @@ -100,7 +100,7 @@ object model. Inverse Relationship ~~~~~~~~~~~~~~~~~~~~ -Relationship definitions in Realm are unidirectional. An +Relationship definitions in the SDK are unidirectional. An **inverse relationship** links an object back to an object that refers to it.