-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
52 additions
and
13 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
...i-details/kotlin/users/custom-user-data-create-custom-user-data-description.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
This example calls an Atlas Function to create custom user data. In this | ||
example, the Atlas Function takes an object passed by the client and | ||
adds it to the custom user data collection in Atlas. | ||
The Function creates the custom user data if it doesn't already exist and | ||
replaces all data in it if it does exist. | ||
|
||
.. literalinclude:: /examples/generated/kotlin/customUserData.snippet.write-custom-user-data.js | ||
:language: js | ||
:caption: writeCustomUserData.js - Atlas Function running on server (JavaScript) | ||
|
||
The Kotlin SDK uses the following code to call this Function. |
11 changes: 11 additions & 0 deletions
11
...i-details/kotlin/users/custom-user-data-delete-custom-user-data-description.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
This example calls an Atlas Function to delete custom user data. | ||
In this example, the Atlas Function does not require any arguments. | ||
The Function uses the function context to determine the caller's user ID, and | ||
deletes the custom user data document matching the user's ID. | ||
|
||
.. literalinclude:: /examples/generated/kotlin/customUserData.snippet.delete-custom-user-data.js | ||
:language: js | ||
:caption: deleteCustomUserData.js - Atlas Function running on server (JavaScript) | ||
|
||
The SDK code that calls this function requires only a logged-in user to | ||
call the function. |
6 changes: 6 additions & 0 deletions
6
...i-details/kotlin/users/custom-user-data-read-custom-user-data-2-description.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
:kotlin-sync-sdk:`User.refreshCustomData() | ||
<io.realm.kotlin.mongodb/-user/refresh-custom-data.html>` | ||
method to request the latest version of a user's custom data. |
4 changes: 4 additions & 0 deletions
4
...api-details/kotlin/users/custom-user-data-read-custom-user-data-description.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
You can read the custom user data of a currently logged-in user using the | ||
:kotlin-sync-sdk:`User.customDataAsBsonDocument() | ||
<io.realm.kotlin.mongodb.ext/custom-data-as-bson-document.html>` | ||
extension function. |
11 changes: 11 additions & 0 deletions
11
...i-details/kotlin/users/custom-user-data-update-custom-user-data-description.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
This example calls an Atlas Function to update custom user data. In this | ||
example, the Atlas Function takes an object passed by the client and | ||
adds it to the custom user data collection in Atlas. | ||
The Function creates the custom user data if it doesn't already exist and | ||
replaces all data in it if it does exist. | ||
|
||
.. literalinclude:: /examples/generated/kotlin/customUserData.snippet.write-custom-user-data.js | ||
:language: js | ||
:caption: writeCustomUserData.js - Atlas Function running on server (JavaScript) | ||
|
||
The Kotlin SDK uses the following code to call this Function. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters