Skip to content

Commit

Permalink
Scaffold page with Swift and Objective-C API descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
dacharyc committed Jul 30, 2024
1 parent fc3abb9 commit 2e5b88f
Show file tree
Hide file tree
Showing 12 changed files with 547 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
The following example :ref:`accesses MongoDB <sdks-access-mongodb>` through
the ``MongoClient`` to insert document a into the custom user data collection.
This document contains the user ID of the currently logged in user and a
``favoriteColor`` value.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.. note::

If you require the most recent version of custom user data, use the
:objc-sdk:`refreshCustomDataWithCompletion
<Classes/RLMUser.html#/c:objc(cs)RLMUser(im)refreshCustomDataWithCompletion:>`
method to request the latest version of a user's custom data.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
To read the data, access the ``customData`` property on the ``User`` object of
a logged-in user.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
To update a user's custom user data with MongoDB Data Access, edit the
MongoDB document whose user ID field contains the user ID of the user.
The following example uses :ref:`MongoDB Data Access <sdks-access-mongodb>` to
update the ``favoriteColor`` field of the the document containing the user ID
of the currently logged in user in the custom user data collection.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
The following example :ref:`accesses MongoDB <sdks-access-mongodb>` through
the ``MongoClient`` to insert document a into the custom user data collection.
This document contains the user ID of the currently logged in user and a
``favoriteColor`` value.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.. note::

If you require the most recent version of custom user data, use the
:swift-sdk:`refreshCustomData()
<Extensions/User.html#/s:So7RLMUserC10RealmSwiftE17refreshCustomData7Combine6FutureCySDys11AnyHashableVypGs5Error_pGyF>`
method to request the latest version of a user's custom data.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
To read the data, access the ``customData`` property on the ``User`` object of
a logged-in user.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
To update a user's custom user data with MongoDB Data Access, edit the
MongoDB document whose user ID field contains the user ID of the user.
The following example uses :ref:`MongoDB Data Access <sdks-access-mongodb>` to
update the ``favoriteColor`` field of the the document containing the user ID
of the currently logged in user in the custom user data collection.
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
.. tabs-drivers::

tabs:
- id: cpp-sdk
content: |

.. literalinclude:: /examples/generated/cpp/asymmetric-sync.snippet.create-asymmetric-object.cpp
:language: cpp

- id: csharp
content: |

.. literalinclude:: /examples/MissingPlaceholders/example.cs
:language: csharp

- id: dart
content: |

.. literalinclude:: /examples/generated/flutter/data_ingest.test.snippet.write-asymmetric-object.dart
:language: dart

- id: java
content: |

.. literalinclude:: /examples/MissingPlaceholders/api.java
:language: java

- id: java-kotlin
content: |

.. literalinclude:: /examples/MissingPlaceholders/example-java-kotlin.kt
:language: kotlin

- id: javascript
content: |

.. literalinclude:: /examples/MissingPlaceholders/example.js
:language: javascript

- id: kotlin
content: |

.. literalinclude:: /examples/generated/kotlin/AsymmetricSyncTest.snippet.create-asymmetric-object.kt
:language: kotlin
:emphasize-lines: 10, 11

- id: objectivec
content: |

.. literalinclude:: /examples/generated/code/start/CustomUserData.snippet.create-custom-user-data.m
:language: objectivec

- id: swift
content: |

.. literalinclude:: /examples/generated/code/start/CustomUserData.snippet.create-custom-user-data.swift
:language: swift

- id: typescript
content: |

.. literalinclude:: /examples/generated/node/asymmetric-sync.snippet.write-asymmetric-object.ts
:language: typescript
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
.. tabs-drivers::

tabs:
- id: cpp-sdk
content: |

.. literalinclude:: /examples/generated/cpp/asymmetric-sync.snippet.create-asymmetric-object.cpp
:language: cpp

- id: csharp
content: |

.. literalinclude:: /examples/MissingPlaceholders/example.cs
:language: csharp

- id: dart
content: |

.. literalinclude:: /examples/generated/flutter/data_ingest.test.snippet.write-asymmetric-object.dart
:language: dart

- id: java
content: |

.. literalinclude:: /examples/MissingPlaceholders/api.java
:language: java

- id: java-kotlin
content: |

.. literalinclude:: /examples/MissingPlaceholders/example-java-kotlin.kt
:language: kotlin

- id: javascript
content: |

.. literalinclude:: /examples/MissingPlaceholders/example.js
:language: javascript

- id: kotlin
content: |

.. literalinclude:: /examples/generated/kotlin/AsymmetricSyncTest.snippet.create-asymmetric-object.kt
:language: kotlin
:emphasize-lines: 10, 11

- id: objectivec
content: |

.. literalinclude:: /examples/generated/code/start/CustomUserData.snippet.read-custom-user-data.m
:language: objectivec

- id: swift
content: |

.. literalinclude:: /examples/generated/code/start/CustomUserData.snippet.read-custom-user-data.swift
:language: swift

- id: typescript
content: |

.. literalinclude:: /examples/generated/node/asymmetric-sync.snippet.write-asymmetric-object.ts
:language: typescript
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
.. tabs-drivers::

tabs:
- id: cpp-sdk
content: |

.. literalinclude:: /examples/generated/cpp/asymmetric-sync.snippet.create-asymmetric-object.cpp
:language: cpp

- id: csharp
content: |

.. literalinclude:: /examples/MissingPlaceholders/example.cs
:language: csharp

- id: dart
content: |

.. literalinclude:: /examples/generated/flutter/data_ingest.test.snippet.write-asymmetric-object.dart
:language: dart

- id: java
content: |

.. literalinclude:: /examples/MissingPlaceholders/api.java
:language: java

- id: java-kotlin
content: |

.. literalinclude:: /examples/MissingPlaceholders/example-java-kotlin.kt
:language: kotlin

- id: javascript
content: |

.. literalinclude:: /examples/MissingPlaceholders/example.js
:language: javascript

- id: kotlin
content: |

.. literalinclude:: /examples/generated/kotlin/AsymmetricSyncTest.snippet.create-asymmetric-object.kt
:language: kotlin
:emphasize-lines: 10, 11

- id: objectivec
content: |

.. literalinclude:: /examples/generated/code/start/CustomUserData.snippet.update-custom-user-data.m
:language: objectivec

- id: swift
content: |

.. literalinclude:: /examples/generated/code/start/CustomUserData.snippet.update-custom-user-data.swift
:language: swift

- id: typescript
content: |

.. literalinclude:: /examples/generated/node/asymmetric-sync.snippet.write-asymmetric-object.ts
:language: typescript
Loading

0 comments on commit 2e5b88f

Please sign in to comment.