Subscriptions allow you to declaratively describe the data that you want a particular device to receive. Once subscribed, Ditto continuously syncs relevant documents that match the query to the local device.
startSync
) in the top-most scope of your code.
To initiate the sync process:
cars
collection with a field of color
set to the value
blue
:
:argument
syntax
in DQL:
subscriptions
method on the ditto.sync
namespace:
cancel
on its subscription object you
instantiated when setting up your subscription.
isCancelled
field on the
subscription object:
stopSync
function. Once called, you will be disconnect from any peers and all active sync subscriptions will be paused.