Skip to content

Commit c33fc22

Browse files
authored
(DOCSP-39525): Consolidate Create and Delete Users page (#3289)
## Pull Request Info - SDK Docs Consolidation Jira ticket: https://jira.mongodb.org/browse/DOCSP-39525 *Staged Page* - [Create, Delete, and Remove Users](https://preview-mongodbdacharyc.gatsbyjs.io/realm/DOCSP-39525/sdk/users/create-and-delete-users/) *Page Source* Add links to every SDK's pages where you got the SDK-specific information: - [Flutter: Delete a User](https://www.mongodb.com/docs/atlas/device-sdks/sdk/flutter/users/delete-user/) - [Java: Create and Delete Users](https://www.mongodb.com/docs/atlas/device-sdks/sdk/java/users/create-delete-users/) - [Kotlin: Delete Users](https://www.mongodb.com/docs/atlas/device-sdks/sdk/kotlin/users/delete-users/) - [.NET: Create and Delete Users](https://www.mongodb.com/docs/atlas/device-sdks/sdk/dotnet/manage-users/create-and-delete-users/) - [Node.js: Create and Delete Users](https://www.mongodb.com/docs/atlas/device-sdks/sdk/node/users/create-delete-users/) - [Swift: Create and Delete Users](https://www.mongodb.com/docs/atlas/device-sdks/sdk/swift/users/create-and-delete-users/) ### PR Author Checklist Before requesting a review for your PR, please check these items: - [x] Open the PR against the `feature-consolidated-sdk-docs` branch instead of `master` - [x] Tag the consolidated page for: - genre - meta.keywords - meta.description #### Naming - [x] Update Realm naming and the language around persistence layer/local/device per [this document](https://docs.google.com/document/d/126OczVxBWAwZ4P5ZsSM29WI3REvONEr1ald-mAwPtyQ/edit?usp=sharing) - [x] Include `.rst` files comply with [the naming guidelines](https://docs.google.com/document/d/1h8cr66zoEVeXytVfvDxlCSsUS5IZwvUQvfSCEXNMpek/edit#heading=h.ulh8b5f2hu9) #### Links and Refs - [x] Create new consolidated SDK ref targets starting with "_sdks-" for relevant sections - [x] Remove or update any SDK-specific refs to use the new consolidated SDK ref targets - [x] [Update any Kotlin API links](https://jira.mongodb.org/browse/DOCSP-32519) to use the new Kotlin SDK roles #### Content - [x] Shared code boxes have snippets or placeholders for all 9 languages - [x] API description sections have API details or a generic placeholder for all 9 languages - [x] Check related pages for relevant content to include - [x] Create a ticket for missing examples in each relevant SDK: Consolidation Gaps epic ### Reviewer Checklist As a reviewer, please check these items: - [x] Shared code example boxes contain language-specific snippets or placeholders for every language - [x] API reference details contain working API reference links or generic content - [x] Realm naming/language has been updated - [x] All relevant content from individual SDK pages is present on the consolidated page
1 parent 8ee6c6b commit c33fc22

22 files changed

+522
-4
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
The C++ SDK does not have the ability to delete users through the SDK.
2+
You can delete users from the server using the :ref:`App Services
3+
Admin API <admin-api>` ``delete a user`` endpoints. You could optionally
4+
create an :ref:`Atlas Function <functions>` that uses the Admin API to
5+
delete a user, and :ref:`call the function from the SDK <sdks-call-function>`.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
The C++ SDK does not have the ability to remove users through the SDK.
2+
Instead, you could :ref:`log out the user <sdks-logout>`, and then manually
3+
delete the user's synced database and cached app files from the filesystem.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
To delete a user, call the :dotnet-sdk:`DeleteUserFromServerAsync(User)
2+
<reference/Realms.Sync.App.html#Realms_Sync_App_DeleteUserFromServerAsync_Realms_Sync_User_>`
3+
method.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Call the :dotnet-sdk:`RemoveUserAsync(User)
2+
<reference/Realms.Sync.App.html#Realms_Sync_App_RemoveUserAsync_Realms_Sync_User_>`
3+
method to remove the user and their data from the device.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Call the :flutter-sdk:`App.deleteUser() <realm/App/deleteUser.html>`
2+
on a user object to delete the user's account from your App Services App.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Call the :flutter-sdk:`App.removeUser() <realm/latest/realm/App/removeUser.html>`
2+
on a user object to remove the user and their data from the device.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
The Java SDK does not have the ability to delete users through the SDK.
2+
You can delete users from the server using the :ref:`App Services
3+
Admin API <admin-api>` ``delete a user`` endpoints. You could optionally
4+
create an :ref:`Atlas Function <functions>` that uses the Admin API to
5+
delete a user, and :ref:`call the function from the SDK <sdks-call-function>`.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
To remove a ``User`` object from your client app, call the
2+
:java-sdk:`User.remove() <io/realm/mongodb/User.html#remove()>` or
3+
:java-sdk:`User.removeAsync()
4+
<io/realm/mongodb/User.html#removeAsync(io.realm.mongodb.App.Callback)>`
5+
method.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Call the :js-sdk:`App.deleteUser() <classes/App.html#deleteUser>` method with a
2+
user object to delete the user from your App Services App. This deletes the
3+
object from the server in addition to clearing data from the device.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Call the :js-sdk:`App.removeUser()
2+
<https://www.mongodb.com/docs/realm-sdks/js/latest/classes/App.html#removeUser>`
3+
method with a user object to remove the user from the device. This clears user
4+
data from the device, but does not delete the user from Atlas.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
To permanently delete a ``User`` object from both your client app
2+
*and* the Atlas App Services App, call the :kotlin-sync-sdk:`delete
3+
<io.realm.kotlin.mongodb/-user/delete.html>` method on a logged-in user:
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
To remove a ``User`` object from your client app, call the
2+
:kotlin-sync-sdk:`remove <io.realm.kotlin.mongodb/-user/remove.html>`
3+
method on a user:
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
You can call the :objc-sdk:`-deleteWithCompletion
2+
<Classes/RLMUser.html#/c:objc(cs)RLMUser(im)deleteWithCompletion:>`
3+
method on a :objc-sdk:`RLMUser object <Classes/RLMUser.html>` to delete the
4+
user object from your App Services App. This deletes the object from the
5+
server in addition to clearing data from the device.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
You can call the :objc-sdk:`-removeWithCompletion
2+
<Classes/RLMUser.html#/c:objc(cs)RLMUser(im)removeWithCompletion:>`
3+
method on a :objc-sdk:`RLMUser object <Classes/RLMUser.html>` to remove the
4+
user from the device. This clears user data from the device, but does not
5+
delete the user from Atlas.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
You can call the :swift-sdk:`delete
2+
<Extensions/User.html#/s:So7RLMUserC10RealmSwiftE6delete7Combine6FutureCyyts5Error_pGyF>`
3+
method on a user object to delete the user object from your App Services App.
4+
This deletes the object from the server in addition to clearing data from the
5+
device.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
You can call the :swift-sdk:`remove
2+
<Extensions/User.html#/s:So7RLMUserC10RealmSwiftE6remove7Combine6FutureCyyts5Error_pGyF>`
3+
method on a user object to remove the user from the device. This clears user
4+
data from the device, but does not delete the user from Atlas.
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
.. tabs-drivers::
2+
3+
tabs:
4+
- id: cpp-sdk
5+
content: |
6+
7+
.. literalinclude:: /examples/MissingPlaceholders/api.cpp
8+
:language: cpp
9+
10+
- id: csharp
11+
content: |
12+
13+
.. literalinclude:: /examples/generated/dotnet/WorkWithRealm.snippet.delete-user.cs
14+
:language: csharp
15+
16+
- id: dart
17+
content: |
18+
19+
.. literalinclude:: /examples/generated/flutter/authenticate_users_test.snippet.delete-user.dart
20+
:language: dart
21+
22+
- id: java
23+
content: |
24+
25+
.. literalinclude:: /examples/MissingPlaceholders/api.java
26+
:language: java
27+
28+
- id: java-kotlin
29+
content: |
30+
31+
.. literalinclude:: /examples/MissingPlaceholders/api-java-kotlin.kt
32+
:language: kotlin
33+
34+
- id: javascript
35+
content: |
36+
37+
.. literalinclude:: /examples/generated/node/authenticate.snippet.delete-user.js
38+
:language: javascript
39+
40+
- id: kotlin
41+
content: |
42+
43+
.. literalinclude:: /examples/generated/kotlin/AuthenticationTest.snippet.delete-user.kt
44+
:language: kotlin
45+
46+
- id: objectivec
47+
content: |
48+
49+
.. literalinclude:: /examples/MissingPlaceholders/example.m
50+
:language: objectivec
51+
52+
- id: swift
53+
content: |
54+
55+
**Async/Await**
56+
57+
.. literalinclude:: /examples/generated/code/start/DeleteUsers.snippet.async-await-delete-user.swift
58+
:language: swift
59+
:copyable: false
60+
61+
**Closure-Style**
62+
63+
.. literalinclude:: /examples/generated/code/start/DeleteUsers.snippet.closure-delete-user.swift
64+
:language: swift
65+
:copyable: false
66+
67+
- id: typescript
68+
content: |
69+
70+
.. literalinclude:: /examples/generated/node/authenticate.snippet.delete-user.js
71+
:language: typescript
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
.. tabs-drivers::
2+
3+
tabs:
4+
- id: cpp-sdk
5+
content: |
6+
7+
.. literalinclude:: /examples/MissingPlaceholders/api.cpp
8+
:language: cpp
9+
10+
- id: csharp
11+
content: |
12+
13+
.. literalinclude:: /examples/MissingPlaceholders/example.cs
14+
:language: csharp
15+
16+
- id: dart
17+
content: |
18+
19+
.. literalinclude:: /examples/MissingPlaceholders/example.dart
20+
:language: dart
21+
22+
- id: java
23+
content: |
24+
25+
.. literalinclude:: /examples/MissingPlaceholders/example.java
26+
:language: java
27+
28+
- id: java-kotlin
29+
content: |
30+
31+
.. literalinclude:: /examples/MissingPlaceholders/example-java-kotlin.kt
32+
:language: kotlin
33+
34+
- id: javascript
35+
content: |
36+
37+
.. literalinclude:: /examples/MissingPlaceholders/example.js
38+
:language: javascript
39+
40+
- id: kotlin
41+
content: |
42+
43+
.. literalinclude:: /examples/generated/kotlin/AuthenticationTest.snippet.remove-user.kt
44+
:language: kotlin
45+
46+
- id: objectivec
47+
content: |
48+
49+
.. literalinclude:: /examples/MissingPlaceholders/example.m
50+
:language: objectivec
51+
52+
- id: swift
53+
content: |
54+
55+
.. literalinclude:: /examples/MissingPlaceholders/example.swift
56+
:language: swift
57+
58+
- id: typescript
59+
content: |
60+
61+
.. literalinclude:: /examples/MissingPlaceholders/example.ts
62+
:language: typescript

source/sdk/users.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Manage Users
1313
.. toctree::
1414
:titlesonly:
1515

16-
Create and Delete Users </sdk/users/create-and-delete-users>
16+
Create, Delete, & Remove Users </sdk/users/create-and-delete-users>
1717
Authenticate Users </sdk/users/authenticate-users>
1818
Custom User Data </sdk/users/custom-user-data>
1919
User Metadata </sdk/users/user-metadata>

source/sdk/users/authenticate-users.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,8 @@ Offline Login
2121

2222
Refresh Token Expiration
2323
------------------------
24+
25+
.. _sdks-logout:
26+
27+
Log a User Out
28+
--------------

0 commit comments

Comments
 (0)