zcollection.view.View.sync#

View.sync(filters=None)[source]#

Synchronize the view with the underlying collection.

This method is useful to update the view after a change in the underlying collection.

Parameters:

filters (str | Callable[[Dict[str, int]], bool] | None) – The predicate used to select the partitions to synchronize. To get more information on the predicate, see the documentation of the zcollection.Collection.partitions() method. If None, the view is synchronized with all the partitions already present in the view. If you want to extend the view with new partitions, use must provide a predicate that selects the new partitions. Existing partitions are not removed, even if they are not selected by the predicate.

Returns:

A function that can be used as a predicate to get the partitions that have been synchronized using the View.partitions() method.

Return type:

Callable[[Dict[str, int]], bool]