Skip to content

Commit c63b55c

Browse files
authored
(DOCSP-41633): Consolidation: Incorporate Counter and Progress Notifications updates (#3331)
## Pull Request Info - SDK Docs Consolidation Jira ticket: https://jira.mongodb.org/browse/DOCSP-41633 Re: counters, the only info I'm pulling in here is for the "Create" page. The rest of the Counter info will be incorporated as we work on other PRs in the consolidation project (for defining a counter property and updating a counter property). *Staged Page* - [Create Property Types/Counters](https://preview-mongodbdacharyc.gatsbyjs.io/realm/incorporate-counters/sdk/crud/create/create-property-types/#create-a-counter-property): Add info for JavaScript and TypeScript about creating objects with the new JS counter type. - [Manage Sync Sessions](https://preview-mongodbdacharyc.gatsbyjs.io/realm/incorporate-counters/sdk/sync/manage-sync-sessions/#check-upload-and-download-progress): Add the .NET example for the new estimate-based progress notifications. *Page Source* Add links to every SDK's pages where you got the SDK-specific information: - [.NET: Monitor Sync Progress](https://www.mongodb.com/docs/atlas/device-sdks/sdk/dotnet/sync/sync-progress/#monitor-sync-progress) - [Node.js: Counters](https://www.mongodb.com/docs/atlas/device-sdks/sdk/node/model-data/data-types/counters/) ### 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` ### 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
1 parent 78520c0 commit c63b55c

7 files changed

+20
-9
lines changed

source/includes/api-details/csharp/sync/manage-sync-sessions-check-upload-and-download-progress-description.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,7 @@ as a double between 0.0 and 1.0.
2424

2525
Once you no longer wish to receive notifications, unregister the token with
2626
``token.Dispose()``.
27+
28+
In the following example, we subscribe to a progress observable on the
29+
``session`` to listen for upload events. When this callback is triggered, it
30+
prints the upload progress as a percentage.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
To initialize a :js-sdk:`Counter <classes/Realm.Types.Counter.html>`, create
2+
your object using the ``realm.create()`` method. Pass in your :ref:`object
3+
schema <sdks-object-schema>` and initial counter value, as well as initial
4+
values for any other properties the object has.
5+
6+
After initialization, you can use the following methods to modify the counter
7+
value:
8+
9+
- ``increment()`` and ``decrement()`` update the underlying value by a
10+
specified number.
11+
- ``set()`` reassigns the counter to a specified value.

source/includes/api-details/javascript/crud/create-counter-property-type-not-supported.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

source/includes/api-details/typescript/crud/create-counter-property-type-not-supported.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

source/includes/sdk-examples/crud/create-counter-property-type.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,8 @@
3636
- id: javascript
3737
content: |
3838

39-
.. literalinclude:: /examples/MissingPlaceholders/api.js
39+
.. literalinclude:: /examples/generated/node/data-types.test.snippet.initialize-counter.js
4040
:language: javascript
41-
:copyable: false
4241

4342
- id: kotlin
4443
content: |
@@ -63,6 +62,5 @@
6362
- id: typescript
6463
content: |
6564

66-
.. literalinclude:: /examples/MissingPlaceholders/api.ts
65+
.. literalinclude:: /examples/generated/node/data-types.test.snippet.initialize-counter.ts
6766
:language: typescript
68-
:copyable: false

source/includes/sdk-examples/sync/manage-sync-sessions-check-upload-download-progress.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
- id: csharp
1111
content: |
1212

13-
.. literalinclude:: /examples/MissingPlaceholders/example.cs
13+
.. literalinclude:: /examples/generated/dotnet/ProgressNotifications.snippet.upload-download-progress-notification.cs
1414
:language: csharp
1515

1616
- id: dart

source/sdk/crud/create/create-property-types.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ counter.
154154
.. tab::
155155
:tabid: javascript
156156

157-
.. include:: /includes/api-details/javascript/crud/create-counter-property-type-not-supported.rst
157+
.. include:: /includes/api-details/javascript/crud/create-counter-property-type-description.rst
158158

159159
.. tab::
160160
:tabid: kotlin
@@ -174,7 +174,7 @@ counter.
174174
.. tab::
175175
:tabid: typescript
176176

177-
.. include:: /includes/api-details/typescript/crud/create-counter-property-type-not-supported.rst
177+
.. include:: /includes/api-details/javascript/crud/create-counter-property-type-description.rst
178178

179179
.. include:: /includes/sdk-examples/crud/create-counter-property-type.rst
180180

0 commit comments

Comments
 (0)