loopback-sync-indices

1.0.2 • Public • Published

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.

Readme

Keywords

Package Sidebar

Install

npm i loopback-sync-indices

Weekly Downloads

6

Version

1.0.2

License

MIT

Unpacked Size

7.04 kB

Total Files

7

Last publish

Collaborators

  • mohamedgr91