-
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.
Add C++ API descriptions, and a Delete section
- Loading branch information
Showing
12 changed files
with
183 additions
and
15 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
.../api-details/cpp/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,10 @@ | ||
In this example, we use an Atlas Function to create the custom user data. The | ||
Function takes an object passed by the client add 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. | ||
|
||
.. include:: /examples/generated/cpp/updateCustomUserData.snippet.update-custom-user-data.js | ||
|
||
The following example :ref:`calls a function <sdks-call-a-function>` to | ||
insert a document containing the user ID of the currently logged in user | ||
and a ``favoriteColor`` value into the custom user data collection. |
9 changes: 9 additions & 0 deletions
9
.../api-details/cpp/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,9 @@ | ||
In this example, we use an Atlas Function to delete the custom user data | ||
document. 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. | ||
|
||
.. include:: /examples/generated/cpp/deleteCustomUserData.snippet.delete-custom-user-data.js | ||
|
||
The code that calls this Function requires only a logged-in user to call | ||
the Function. |
6 changes: 6 additions & 0 deletions
6
.../api-details/cpp/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 | ||
:cpp-sdk:`refresh_custom_user_data() | ||
<structrealm_1_1user.html#a6e08623890de4003a00a351e939a0a9f>` | ||
function to request the latest version of a user's custom data. |
2 changes: 2 additions & 0 deletions
2
...es/api-details/cpp/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,2 @@ | ||
To read the data, access the ``custom_data`` property on the ``User`` object | ||
of a logged-in user. |
5 changes: 5 additions & 0 deletions
5
.../api-details/cpp/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,5 @@ | ||
To update a user's custom user data with an Atlas Function, edit the | ||
MongoDB document whose user ID field contains the user ID of the user. | ||
The following example calls the same function used to create the custom user | ||
data document above. Here, we update the ``favoriteColor`` field of the | ||
the document containing the user ID of the currently logged in user. |
File renamed without changes.
File renamed without changes.
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
71 changes: 71 additions & 0 deletions
71
source/includes/sdk-examples/users/custom-user-data-delete-custom-user-data.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,71 @@ | ||
.. tabs-drivers:: | ||
|
||
tabs: | ||
- id: cpp-sdk | ||
content: | | ||
|
||
.. literalinclude:: /examples/generated/cpp/custom-user-data.snippet.delete.cpp | ||
:language: cpp | ||
|
||
- id: csharp | ||
content: | | ||
|
||
.. literalinclude:: /examples/MissingPlaceholders/example.cs | ||
:language: csharp | ||
:copyable: false | ||
|
||
- id: dart | ||
content: | | ||
|
||
.. literalinclude:: /examples/MissingPlaceholders/example.dart | ||
:language: dart | ||
:copyable: false | ||
|
||
- id: java | ||
content: | | ||
|
||
.. literalinclude:: /examples/MissingPlaceholders/example.java | ||
:language: java | ||
:copyable: false | ||
|
||
- id: java-kotlin | ||
content: | | ||
|
||
.. literalinclude:: /examples/MissingPlaceholders/example-java-kotlin.kt | ||
:language: kotlin | ||
:copyable: false | ||
|
||
- id: javascript | ||
content: | | ||
|
||
.. literalinclude:: /examples/MissingPlaceholders/example.js | ||
:language: javascript | ||
:copyable: false | ||
|
||
- id: kotlin | ||
content: | | ||
|
||
.. literalinclude:: /examples/generated/kotlin/AsymmetricSyncTest.snippet.create-asymmetric-object.kt | ||
:language: kotlin | ||
:emphasize-lines: 10, 11 | ||
|
||
- id: objectivec | ||
content: | | ||
|
||
.. literalinclude:: /examples/MissingPlaceholders/example.m | ||
:language: objectivec | ||
:copyable: false | ||
|
||
- id: swift | ||
content: | | ||
|
||
.. literalinclude:: /examples/MissingPlaceholders/example.swift | ||
:language: swift | ||
:copyable: false | ||
|
||
- id: typescript | ||
content: | | ||
|
||
.. literalinclude:: /examples/MissingPlaceholders/example.ts | ||
:language: typescript | ||
:copyable: false |
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