1.2.1 • Published 7 years ago

simple-mongoose-autoincrement v1.2.1

Weekly downloads
31
License
MIT
Repository
github
Last release
7 years ago

Mongoose Auto-Increment

Mongoose plugin for auto-increment number ID and given field name.

Install

npm install --save simple-mongoose-autoincrement

#####or

yarn add simple-mongoose-autoincrement

Usage

// Using with global.
var mongoose = require('mongoose');
var autoincrement = require('simple-mongoose-autoincrement');

mongoose.plugin(autoincrement, {/*no field name*/});
// Using with a model and option.
var mongoose = require('mongoose');
var autoincrement = require('simple-mongoose-autoincrement');
var sampleSchema = mongoose.Schema({
  data: String
});
sampleSchema.plugin(autoincrement, {field: 'sequnece' /*with field name*/});

###If you need more informations see test.js

License

MIT

1.2.1

7 years ago

1.2.0

7 years ago

1.1.0

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago