-
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 subscribe to query with name section
- Loading branch information
Showing
7 changed files
with
173 additions
and
26 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
...art/sync/manage-sync-subscriptions-subscribe-to-query-with-name-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,7 @@ | ||
To subscribe to a query with a name, pass the following arguments to ``subscribe()``: | ||
|
||
- ``RealmResults query``: Required. A ``RealmResults`` object that you can create using the | ||
:ref:`Realm Query Language <rql>`. | ||
- ``String name``: Optional. Name for the subscription that you can refer to. | ||
|
||
In the following example, we subscribe to two new named queries. |
7 changes: 7 additions & 0 deletions
7
...nc/manage-sync-subscriptions-subscribe-to-query-with-name-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,7 @@ | ||
To subscribe to a query: | ||
|
||
#. Query for the objects that you want to read and write. | ||
#. Call ``subscribe()`` on the query results to create a sync subscription for | ||
objects matching the query. | ||
#. Pass a ``SubscriptionOptions`` object that contains the ``name`` property to | ||
``subscribe()``. |
1 change: 1 addition & 0 deletions
1
...lin/sync/manage-sync-subscriptions-subscribe-to-query-with-name-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 @@ | ||
To add a name to the subscription, pass a string when you call ``.subscribe()``. |
4 changes: 4 additions & 0 deletions
4
...ift/sync/manage-sync-subscriptions-subscribe-to-query-with-name-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,4 @@ | ||
To give a query subscription a name, supply a string name argument for the | ||
``name`` parameter when you call the :swift-sdk:`.subscribe() | ||
<Structs/Results.html#/s:10RealmSwift7ResultsV9subscribe4name11waitForSync7timeoutACyxGSSSg_So07RLMWaitgH4ModeVSdSgtYaKF>` | ||
method. |
61 changes: 61 additions & 0 deletions
61
...es/sdk-examples/sync/manage-sync-subscriptions-subscribe-to-query-with-name.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,61 @@ | ||
.. tabs-drivers:: | ||
|
||
tabs: | ||
- id: cpp | ||
content: | | ||
|
||
.. literalinclude:: /examples/MissingPlaceholders/api.cpp | ||
:language: cpp | ||
:copyable: false | ||
|
||
- id: csharp | ||
content: | | ||
|
||
.. literalinclude:: /examples/MissingPlaceholders/api.cs | ||
:language: csharp | ||
:copyable: false | ||
|
||
- id: dart | ||
content: | | ||
|
||
.. literalinclude:: /examples/generated/flutter/manage_sync_subscription_test.snippet.add-subscription-subscribe-api.dart | ||
:language: dart | ||
|
||
- id: java | ||
content: | | ||
|
||
.. literalinclude:: /examples/MissingPlaceholders/api.java | ||
:language: java | ||
:copyable: false | ||
|
||
- id: java-kotlin | ||
content: | | ||
|
||
.. literalinclude:: /examples/MissingPlaceholders/api-java-kotlin.kt | ||
:language: kotlin | ||
:copyable: false | ||
|
||
- id: javascript | ||
content: | | ||
|
||
.. literalinclude:: /examples/generated/node/v12/manage-subscriptions.test.snippet.sub-name.js | ||
:language: javascript | ||
|
||
- id: kotlin | ||
content: | | ||
|
||
.. literalinclude:: /examples/generated/kotlin/SyncTest.snippet.subscribe-named-query.kt | ||
:language: kotlin | ||
:emphasize-lines: 3 | ||
|
||
- id: swift | ||
content: | | ||
|
||
.. literalinclude:: /examples/generated/code/start/FlexibleSync.snippet.subscribe-to-results-with-name.swift | ||
:language: swift | ||
|
||
- id: typescript | ||
content: | | ||
|
||
.. literalinclude:: /examples/generated/node/v12/manage-subscriptions.test.snippet.sub-name.ts | ||
:language: typescript |
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