SDK
SDK Javascript v6.x
1

You are currently looking at the documentation of a previous version of Kuzzle. We strongly recommend that you use the latest version. You can also use the version selector in the top menu.

count #

Returns the number of other connections sharing the same subscription.

Arguments #

count(roomId, [options]);

ArgumentsTypeDescription
roomId
string
Subscription room ID
options
object
Query options

options #

Additional query options

OptionType
(default)
Description
queuable
boolean

(true)
Make this request queuable or not

Resolves #

Resolves to a number represensting active connections using the same provided subscription room.

Usage #

try {
  const roomId = await kuzzle.realtime.subscribe(
    'nyc-open-data',
    'yellow-taxi',
    {},
    () => {}
  );
  const count = await kuzzle.realtime.count(roomId);
  console.log(`Currently ${count} active subscription`);
} catch (error) {
  console.error(error.message);
}