Unsubscribing subscriptions (Partially sync realm)


I can’t seem to unsubscribe active subscriptions of a partially synced realm.
I retrieve all subscription using realm.subscriptions() and then try to iterate and unsubscribed each subscription object.

let subscriptions = realm.subscriptions();

var i;
for (i = 0; i < subscriptions.length; i++) {
let subscriptionName = subscriptions[i].name;

This result with an error :

undefined is not a function (evaluating ‘realm.unsubscribe(subscriptionName)’)

What am im doing wrong?

Thank you