sails-hook-mongo-index
v1.0.5
Published
SailsJS hook which ensures that indexes created for mongodb models/collections
Downloads
5
Maintainers
Readme
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
}