title: an auto-increment version in document creation mongoose
body: <p>I want that when a new document is created the versionKey (__v) field will auto-increment.</p>
  <p>(or should I use a new field 'version' instead __v in the schema?)</p>
  <p>example for the schema in my app :</p>
  <p><strong>Template.js</strong></p>
  <pre><code>var mongoose = require('mongoose');
  const Test = require('./Test');
  
  var TemplateSchema = new mongoose.Schema({
    platform: String,
    templateRevision: String,
    tests: [Test.schema]
  });
  
  TemplateSchema.pre('save', function(next) {
    this.increment();
    return next();
  });
  
  module.exports = mongoose.model('Template', TemplateSchema);
  </code></pre>
  <p><strong>routes/templatesApi.js</strong></p>
  <pre><code>// create new template document
  router.post('/', function(req, res, next) {
      Test.create(req.body, function (err, tests) {
          if (err) {
              console.log(err);
              return next(err);
          }
          res.json(tests);
      });
  });
  </code></pre>
  <p>where and how can I insert the auto-increment operation for versionKey property here?</p>
  <p>Edit: I tried to use <code>.pre('save')</code> middleware and it still not working.</p>
  <p>am I using it right?</p>