-
Notifications
You must be signed in to change notification settings - Fork 89
(DOCSP-39525): Consolidate Create and Delete Users page #3289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
dacharyc
merged 2 commits into
mongodb:feature-consolidated-sdk-docs
from
dacharyc:DOCSP-39525
Jun 18, 2024
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
...cludes/api-details/cpp/users/create-delete-users-delete-users-not-supported.rst
This file contains hidden or 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 @@ | ||
The C++ SDK does not have the ability to delete users through the SDK. | ||
You can delete users from the server using the :ref:`App Services | ||
Admin API <admin-api>` ``delete a user`` endpoints. You could optionally | ||
create an :ref:`Atlas Function <functions>` that uses the Admin API to | ||
delete a user, and :ref:`call the function from the SDK <sdks-call-function>`. |
3 changes: 3 additions & 0 deletions
3
...cludes/api-details/cpp/users/create-delete-users-remove-users-not-supported.rst
This file contains hidden or 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,3 @@ | ||
The C++ SDK does not have the ability to remove users through the SDK. | ||
Instead, you could :ref:`log out the user <sdks-logout>`, and then manually | ||
delete the user's synced database and cached app files from the filesystem. |
3 changes: 3 additions & 0 deletions
3
...ludes/api-details/csharp/users/create-delete-users-delete-users-description.rst
This file contains hidden or 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,3 @@ | ||
To delete a user, call the :dotnet-sdk:`DeleteUserFromServerAsync(User) | ||
<reference/Realms.Sync.App.html#Realms_Sync_App_DeleteUserFromServerAsync_Realms_Sync_User_>` | ||
method. |
3 changes: 3 additions & 0 deletions
3
...ludes/api-details/csharp/users/create-delete-users-remove-users-description.rst
This file contains hidden or 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,3 @@ | ||
Call the :dotnet-sdk:`RemoveUserAsync(User) | ||
<reference/Realms.Sync.App.html#Realms_Sync_App_RemoveUserAsync_Realms_Sync_User_>` | ||
method to remove the user and their data from the device. |
2 changes: 2 additions & 0 deletions
2
...ncludes/api-details/dart/users/create-delete-users-delete-users-description.rst
This file contains hidden or 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 @@ | ||
Call the :flutter-sdk:`App.deleteUser() <realm/App/deleteUser.html>` | ||
on a user object to delete the user's account from your App Services App. |
2 changes: 2 additions & 0 deletions
2
...ncludes/api-details/dart/users/create-delete-users-remove-users-description.rst
This file contains hidden or 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 @@ | ||
Call the :flutter-sdk:`App.removeUser() <realm/latest/realm/App/removeUser.html>` | ||
on a user object to remove the user and their data from the device. |
5 changes: 5 additions & 0 deletions
5
...ludes/api-details/java/users/create-delete-users-delete-users-not-supported.rst
This file contains hidden or 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 @@ | ||
The Java SDK does not have the ability to delete users through the SDK. | ||
You can delete users from the server using the :ref:`App Services | ||
Admin API <admin-api>` ``delete a user`` endpoints. You could optionally | ||
create an :ref:`Atlas Function <functions>` that uses the Admin API to | ||
delete a user, and :ref:`call the function from the SDK <sdks-call-function>`. |
5 changes: 5 additions & 0 deletions
5
...ncludes/api-details/java/users/create-delete-users-remove-users-description.rst
This file contains hidden or 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 remove a ``User`` object from your client app, call the | ||
:java-sdk:`User.remove() <io/realm/mongodb/User.html#remove()>` or | ||
:java-sdk:`User.removeAsync() | ||
<io/realm/mongodb/User.html#removeAsync(io.realm.mongodb.App.Callback)>` | ||
method. |
3 changes: 3 additions & 0 deletions
3
...details/javascript/users/create-delete-users-delete-users-js-ts-description.rst
This file contains hidden or 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,3 @@ | ||
Call the :js-sdk:`App.deleteUser() <classes/App.html#deleteUser>` method with a | ||
user object to delete the user from your App Services App. This deletes the | ||
object from the server in addition to clearing data from the device. |
4 changes: 4 additions & 0 deletions
4
...details/javascript/users/create-delete-users-remove-users-js-ts-description.rst
This file contains hidden or 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 @@ | ||
Call the :js-sdk:`App.removeUser() | ||
<https://www.mongodb.com/docs/realm-sdks/js/latest/classes/App.html#removeUser>` | ||
method with a user object to remove the user from the device. This clears user | ||
data from the device, but does not delete the user from Atlas. |
3 changes: 3 additions & 0 deletions
3
...ludes/api-details/kotlin/users/create-delete-users-delete-users-description.rst
This file contains hidden or 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,3 @@ | ||
To permanently delete a ``User`` object from both your client app | ||
*and* the Atlas App Services App, call the :kotlin-sync-sdk:`delete | ||
<io.realm.kotlin.mongodb/-user/delete.html>` method on a logged-in user: |
3 changes: 3 additions & 0 deletions
3
...ludes/api-details/kotlin/users/create-delete-users-remove-users-description.rst
This file contains hidden or 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,3 @@ | ||
To remove a ``User`` object from your client app, call the | ||
:kotlin-sync-sdk:`remove <io.realm.kotlin.mongodb/-user/remove.html>` | ||
method on a user: |
5 changes: 5 additions & 0 deletions
5
...s/api-details/objectivec/users/create-delete-users-delete-users-description.rst
This file contains hidden or 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 @@ | ||
You can call the :objc-sdk:`-deleteWithCompletion | ||
<Classes/RLMUser.html#/c:objc(cs)RLMUser(im)deleteWithCompletion:>` | ||
method on a :objc-sdk:`RLMUser object <Classes/RLMUser.html>` to delete the | ||
user object from your App Services App. This deletes the object from the | ||
server in addition to clearing data from the device. |
5 changes: 5 additions & 0 deletions
5
...s/api-details/objectivec/users/create-delete-users-remove-users-description.rst
This file contains hidden or 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 @@ | ||
You can call the :objc-sdk:`-removeWithCompletion | ||
<Classes/RLMUser.html#/c:objc(cs)RLMUser(im)removeWithCompletion:>` | ||
method on a :objc-sdk:`RLMUser object <Classes/RLMUser.html>` to remove the | ||
user from the device. This clears user data from the device, but does not | ||
delete the user from Atlas. |
5 changes: 5 additions & 0 deletions
5
...cludes/api-details/swift/users/create-delete-users-delete-users-description.rst
This file contains hidden or 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 @@ | ||
You can call the :swift-sdk:`delete | ||
<Extensions/User.html#/s:So7RLMUserC10RealmSwiftE6delete7Combine6FutureCyyts5Error_pGyF>` | ||
method on a user object to delete the user object from your App Services App. | ||
This deletes the object from the server in addition to clearing data from the | ||
device. |
4 changes: 4 additions & 0 deletions
4
...cludes/api-details/swift/users/create-delete-users-remove-users-description.rst
This file contains hidden or 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 call the :swift-sdk:`remove | ||
<Extensions/User.html#/s:So7RLMUserC10RealmSwiftE6remove7Combine6FutureCyyts5Error_pGyF>` | ||
method on a user object to remove the user from the device. This clears user | ||
data from the device, but does not delete the user from Atlas. |
71 changes: 71 additions & 0 deletions
71
source/includes/sdk-examples/users/create-delete-users-delete-users-from-atlas.rst
This file contains hidden or 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/MissingPlaceholders/api.cpp | ||
:language: cpp | ||
|
||
- id: csharp | ||
content: | | ||
|
||
.. literalinclude:: /examples/generated/dotnet/WorkWithRealm.snippet.delete-user.cs | ||
:language: csharp | ||
|
||
- id: dart | ||
content: | | ||
|
||
.. literalinclude:: /examples/generated/flutter/authenticate_users_test.snippet.delete-user.dart | ||
:language: dart | ||
|
||
- id: java | ||
content: | | ||
|
||
.. literalinclude:: /examples/MissingPlaceholders/api.java | ||
:language: java | ||
|
||
- id: java-kotlin | ||
content: | | ||
|
||
.. literalinclude:: /examples/MissingPlaceholders/api-java-kotlin.kt | ||
:language: kotlin | ||
|
||
- id: javascript | ||
content: | | ||
|
||
.. literalinclude:: /examples/generated/node/authenticate.snippet.delete-user.js | ||
:language: javascript | ||
|
||
- id: kotlin | ||
content: | | ||
|
||
.. literalinclude:: /examples/generated/kotlin/AuthenticationTest.snippet.delete-user.kt | ||
:language: kotlin | ||
|
||
- id: objectivec | ||
content: | | ||
|
||
.. literalinclude:: /examples/MissingPlaceholders/example.m | ||
:language: objectivec | ||
|
||
- id: swift | ||
content: | | ||
|
||
**Async/Await** | ||
|
||
.. literalinclude:: /examples/generated/code/start/DeleteUsers.snippet.async-await-delete-user.swift | ||
:language: swift | ||
:copyable: false | ||
|
||
**Closure-Style** | ||
|
||
.. literalinclude:: /examples/generated/code/start/DeleteUsers.snippet.closure-delete-user.swift | ||
:language: swift | ||
:copyable: false | ||
|
||
- id: typescript | ||
content: | | ||
|
||
.. literalinclude:: /examples/generated/node/authenticate.snippet.delete-user.js | ||
:language: typescript |
62 changes: 62 additions & 0 deletions
62
...ce/includes/sdk-examples/users/create-delete-users-remove-users-from-device.rst
This file contains hidden or 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,62 @@ | ||
.. tabs-drivers:: | ||
|
||
tabs: | ||
- id: cpp-sdk | ||
content: | | ||
|
||
.. literalinclude:: /examples/MissingPlaceholders/api.cpp | ||
:language: cpp | ||
|
||
- id: csharp | ||
content: | | ||
|
||
.. literalinclude:: /examples/MissingPlaceholders/example.cs | ||
:language: csharp | ||
|
||
- id: dart | ||
content: | | ||
|
||
.. literalinclude:: /examples/MissingPlaceholders/example.dart | ||
:language: dart | ||
|
||
- id: java | ||
content: | | ||
|
||
.. literalinclude:: /examples/MissingPlaceholders/example.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/AuthenticationTest.snippet.remove-user.kt | ||
:language: kotlin | ||
|
||
- id: objectivec | ||
content: | | ||
|
||
.. literalinclude:: /examples/MissingPlaceholders/example.m | ||
:language: objectivec | ||
|
||
- id: swift | ||
content: | | ||
|
||
.. literalinclude:: /examples/MissingPlaceholders/example.swift | ||
:language: swift | ||
|
||
- id: typescript | ||
content: | | ||
|
||
.. literalinclude:: /examples/MissingPlaceholders/example.ts | ||
:language: typescript |
This file contains hidden or 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 hidden or 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 |
---|---|---|
|
@@ -21,3 +21,8 @@ Offline Login | |
|
||
Refresh Token Expiration | ||
------------------------ | ||
|
||
.. _sdks-logout: | ||
|
||
Log a User Out | ||
-------------- |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it intentional that the Swift examples have
XCTAssert
statements? Seems problematic for copy/paste. Probably not worth addressing as part of the consolidation work.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is intentional as we were experimenting with different ways to show information in code examples. But it's a direction we decided not to take after this, and probably warrants being updated/removed. I can make it non copyable for now, and will update the Swift follow up ticket for this page to remove the asserts.