1.0.5 • Published 4 years ago

sails-hook-mongo-index v1.0.5

Weekly downloads
2
License
ISC
Repository
github
Last release
4 years ago

sails-hook-mongo-index

By default sails.js does not create mongo indexes indexes defined in models.

This hook ensures that indexes created if they does not exist.

Install

npm install --save sails-hook-mongo-index

How To

Simply install the package.

Example how to add indexes:

name: {
  type: 'string',
  index: true
}

for unique:

name: {
  type: 'string',
  unique: true
}