0.0.3 • Published 3 years ago

@bouncingpixel/mongoose-helpers v0.0.3

Weekly downloads
6
License
MIT
Repository
github
Last release
3 years ago

mongoose-helpers

Collection of Mongoose schema plugins.

Working With

Requirements

  • NodeJS 6 LTS

Installing

Install the package using your JS package manager of choice, such as npm or yarn.

For example, with npm or yarn:

$ npm install --save @bouncingpixel/mongoose-helpers

$ yarn add @bouncingpixel/mongoose-helpers

Using mongoose-helpers/auto-bcrypt

Just add the plugin to the schema and set the fields which are automatically bcrypt'd

MySchema.plugin(require('@bouncingpixel/mongoose-helpers/auto-bcrypt'), {
  fields: ['password']
});

Using mongoose-helpers/replace-image

Add the plugin to the schema, set the fields that are managed images, and set the remover function.

MySchema.plugin(require('@bouncingpixel/mongoose-helpers/replace-image'), {
  fields: ['previewImage'],
  remover: RackspaceService.removeFile
});
0.0.3

3 years ago

0.1.0-1-beta

3 years ago

0.1.0-beta

3 years ago

0.0.2

7 years ago

0.0.1

7 years ago