-
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.
(DOCSP-39528): Consolidate User Metadata page (#3344)
## Pull Request Info - SDK Docs Consolidation Jira ticket: https://jira.mongodb.org/browse/DOCSP-39528 *Staged Page* - [User Metadata](https://preview-mongodbdacharyc.gatsbyjs.io/realm/DOCSP-39528/sdk/users/user-metadata/) *Page Source* Add links to every SDK's pages where you got the SDK-specific information: - [Flutter: User Metadata](https://www.mongodb.com/docs/atlas/device-sdks/sdk/flutter/users/user-metadata/) - [Kotlin: Manage User Metadata](https://www.mongodb.com/docs/atlas/device-sdks/sdk/kotlin/users/user-metadata/) - [.NET: User Metadata](https://www.mongodb.com/docs/atlas/device-sdks/sdk/dotnet/manage-users/user-metadata/) - [Node.js: User Metadata](https://www.mongodb.com/docs/atlas/device-sdks/sdk/node/users/user-metadata/) - [Swift: User Metadata](https://www.mongodb.com/docs/atlas/device-sdks/sdk/swift/users/user-metadata/) ### 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: - [ ] Shared code example boxes contain language-specific snippets or placeholders for every language - [ ] API reference details contain working API reference links or generic content - [ ] Realm naming/language has been updated - [ ] All relevant content from individual SDK pages is present on the consolidated page
- Loading branch information
Showing
11 changed files
with
204 additions
and
20 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
...ludes/api-details/csharp/users/user-metadata-read-user-metadata-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,8 @@ | ||
You can read the user metadata of a currently logged-in user through the | ||
:dotnet-sdk:`User <reference/Realms.Sync.User.html>` object. | ||
|
||
The ``Profile`` property on the ``User`` object returns a | ||
:dotnet-sdk:`UserProfile <reference/Realms.Sync.UserProfile.html>` object | ||
of a logged-in user. | ||
|
||
The following example shows how to get a user's email from the metadata. |
8 changes: 8 additions & 0 deletions
8
...ncludes/api-details/dart/users/user-metadata-read-user-metadata-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,8 @@ | ||
You can read the user metadata of a currently logged-in user through the | ||
:flutter-sdk:`User <realm/User-class.html>` object. | ||
|
||
The ``profile`` property on the ``User`` object returns a | ||
:flutter-sdk:`User.profile <realm/User/profile.html>` object | ||
of a logged-in user. | ||
|
||
The following example shows how to get a user's email from the metatdata. |
2 changes: 2 additions & 0 deletions
2
...etails/generic/users/user-metadata-serializable-user-metadata-not-supported.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 @@ | ||
The selected language does not provide serializable user metadata. This | ||
functionality is only available in Kotlin. |
5 changes: 5 additions & 0 deletions
5
...details/javascript/users/user-metadata-read-user-metadata-js-ts-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 @@ | ||
You can read the user metadata of a currently logged-in user through that | ||
user's ``User`` object. | ||
|
||
To read the data, access the ``profile`` property on the ``User`` object | ||
of a logged-in user. |
8 changes: 8 additions & 0 deletions
8
...ludes/api-details/kotlin/users/user-metadata-read-user-metadata-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,8 @@ | ||
You can read the user metadata of a currently logged-in user through | ||
that user's | ||
:kotlin-sync-sdk:`User <io.realm.kotlin.mongodb/-user/index.html>` | ||
object. You cannot edit user metadata through a ``User`` object. | ||
|
||
To read the data, call the :kotlin-sync-sdk:`profileAsBsonDocument | ||
<io.realm.kotlin.mongodb.ext/profile-as-bson-document.html>` | ||
method on the ``User`` object of a logged-in user. |
14 changes: 14 additions & 0 deletions
14
...i-details/kotlin/users/user-metadata-serializable-user-metadata-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,14 @@ | ||
.. versionadded:: 1.9.0 | ||
|
||
Kotlin SDK version 1.9.0 introduced an API that supports: | ||
|
||
- A limited but stable EJSON encoder for user metadata returned by ``User.profileAsBsonDocument()`` | ||
- An experimental EJSON encoder that supports full document serialization for user | ||
metadata returned by the :kotlin-sync-sdk:`User.profile() | ||
<io.realm.kotlin.mongodb.ext/profile.html>` extension method. This encoder | ||
and method requires experimental opt-in. | ||
|
||
You must add the official | ||
`Kotlin Serialization <https://github.com/Kotlin/kotlinx.serialization>`__ | ||
library to your project to use the Kotlin SDK's EJSON serialization. | ||
For more information, refer to :ref:`Serialization <sdks-serialization>`. |
5 changes: 5 additions & 0 deletions
5
...cludes/api-details/swift/users/user-metadata-read-user-metadata-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 @@ | ||
You can read the user metadata of a currently logged-in user through that | ||
user's ``User`` object. | ||
|
||
To read the data, access the ``profile`` property on the ``User`` object | ||
of a logged-in user. |
This file was deleted.
Oops, something went wrong.
38 changes: 38 additions & 0 deletions
38
source/includes/sdk-examples/users/user-metadata-read-user-metadata.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,38 @@ | ||
.. tabs-drivers:: | ||
|
||
tabs: | ||
- id: csharp | ||
content: | | ||
|
||
.. literalinclude:: /examples/generated/dotnet/UserLinkExamples.snippet.user-metadata.cs | ||
:language: csharp | ||
|
||
- id: dart | ||
content: | | ||
|
||
.. literalinclude:: /examples/generated/flutter/authenticate_users_test.snippet.user-metadata.dart | ||
:language: dart | ||
|
||
- id: javascript | ||
content: | | ||
|
||
.. literalinclude:: /examples/generated/node/authenticate.snippet.user-metadata.js | ||
:language: js | ||
|
||
- id: kotlin | ||
content: | | ||
|
||
.. literalinclude:: /examples/generated/kotlin/AuthenticationTest.snippet.get-user-metadata.kt | ||
:language: kotlin | ||
|
||
- id: swift | ||
content: | | ||
|
||
.. literalinclude:: /examples/generated/code/start/Authenticate.snippet.read-user-metadata.swift | ||
:language: swift | ||
|
||
- id: typescript | ||
content: | | ||
|
||
.. literalinclude:: /examples/generated/node/authenticate.snippet.user-metadata.js | ||
:language: js |
This file was deleted.
Oops, something went wrong.
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