Skip to content

(DOCSP-24293): Add note about writeCopy only supporting PBS #2074

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
merged 1 commit into from
Aug 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions source/includes/note-writecopy-pbs-only.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.. note:: Partition-Based Sync Only

This method only supports Partition-Based Sync. If your app uses
Flexible Sync, you must manually iterate through the objects in one
realm and copy them into the other realm.
2 changes: 2 additions & 0 deletions source/sdk/node/examples/open-and-close-a-realm.txt
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ To copy data from an existing realm to a new realm with different
configuration options, pass the new configuration the
:js-sdk:`Realm.writeCopyTo() <Realm.html#writeCopyTo>` method.

.. include:: /includes/note-writecopy-pbs-only.rst

In the new realm's configuration, you *must* specify the ``path``.

If you write the copied realm to a realm file that already exists, the data is written object by object.
Expand Down
2 changes: 2 additions & 0 deletions source/sdk/react-native/examples/open-and-close-a-realm.txt
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ To copy data from an existing realm to a new realm with different
configuration options, pass the new configuration the
:js-sdk:`Realm.writeCopyTo() <Realm.html#writeCopyTo>` method.

.. include:: /includes/note-writecopy-pbs-only.rst

In the new realm's configuration, you *must* specify the ``path``.

If you write the copied realm to a realm file that already exists, the data is written object by object.
Expand Down
4 changes: 4 additions & 0 deletions source/sdk/swift/sync/configure-and-open-a-synced-realm.txt
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,8 @@ configuration.
After you copy the realm for the new Sync user's configuration, you can
open the copy as a synced realm for that user.

.. include:: /includes/note-writecopy-pbs-only.rst

.. literalinclude:: /examples/generated/code/start/ConvertSyncLocalRealms.snippet.convert-sync-to-sync.swift
:language: swift

Expand All @@ -215,6 +217,8 @@ synced realm. Any changes you make to the synced realm will reflect
in the synced realm file, and they will also propogate to other devices and
the Atlas App Services backend.

.. include:: /includes/note-writecopy-pbs-only.rst

.. literalinclude:: /examples/generated/code/start/ConvertSyncLocalRealms.snippet.convert-local-to-sync.swift
:language: swift

Expand Down