mongoose-plugin-date-format
TypeScript icon, indicating that this package has built-in type declarations

1.2.1 • Public • Published

mongoose-plugin-date-format

CI npm version

Change the date field default output in your mongoose schemas

Note: This plugin will only work with mongoose >= 4.0. Do NOT use this plugin with mongoose 3.x. You have been warned.

Usage

The mongoose-plugin-date-format module exposes a single function that you can pass to Mongoose schema's plugin() function.

const schema = new mongoose.Schema({
  birthdate: Date,
});
schema.plugin(require('mongoose-plugin-date-format')('YYYY-MM-DDTHH:mm:ss[Z]'));

/mongoose-plugin-date-format/

    Package Sidebar

    Install

    npm i mongoose-plugin-date-format

    Weekly Downloads

    0

    Version

    1.2.1

    License

    MIT

    Unpacked Size

    15.9 kB

    Total Files

    14

    Last publish

    Collaborators

    • oktapodia