Skip to content

gemyero/loopback-sync-indices

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

loopback-sync-indices

A module exports a function that can be called with a loopback 3 application to sync indexes between loopback models and databases.

Installation

npm install loopback-sync-indices

Usage

const syncIndexes = require('loopback-sync-indices');

const app = loopback();
syncIndexes(app);

Api

syncIndexes(app, options)

parameters

  • app: loopback application
  • options.maxRetryCount (Number = 3): maximum number of retries
  • options.dropIndexes (Boolean = false): whether to remove db indexes that are not in loopback
  • options.recreateIndexesErrorCodes (Array = ['IndexOptionsConflict', 'IndexKeySpecsConflict']): error codes to recreate conflicting indexes.
  • options.reservedIndexes (Array = ['_id_']): indexes not to be dropped from db.

Limitation

  • Supports only MongoDB connector.

Roadmap

  • Add support for other connectors.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •