SDK
SDK Javascript v7.x
2

refresh #

Forces an immediate reindexation of the provided security collection.

The available security collections are: users, profiles, roles.

When writing or deleting documents in Kuzzle, the changes need to be indexed before being reflected in the search results. By default, this operation can take up to 1 second.

Forcing immediate refreshes comes with performance costs, and should only performed when absolutely necessary.

Copied to clipboard!
refresh(collection);

Arguments #

  • collection: collection name to refresh

Resolves #

Resolves when the refresh has been done.

Usage #

Copied to clipboard!
try {
  await kuzzle.security.refresh('users');
  console.log('Success');
} catch (e) {
  console.error(e);
}