1.0.2 • Published 4 years ago

loopback-sync-indices v1.0.2

Weekly downloads
13
License
MIT
Repository
github
Last release
4 years ago

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.
1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago