Skip to content

Function: syncRbacIndexes() ​

ts
function syncRbacIndexes(models): Promise<void>;

Defined in: packages/mongoose/src/models.ts:198

Creates the collections' indexes (unique constraints included). Call it once at deploy/startup when Mongoose autoIndex is disabled; with autoIndex on (the default) the adapter waits for them itself.

Parameters ​

ParameterType
modelsRbacModels

Returns ​

Promise<void>

Released under the MIT License. Inspired by spatie/laravel-permission.