index.js
function (callback) {
    IdentityCounter.findOneAndUpdate(
      { model: settings.model, field: settings.field },
      { count: settings.startAt - settings.incrementBy },
      { new: true }, // new: true specifies that the callback should get the updated counter.
      function (err) {
        if (err) return callback(err);
        callback(null, settings.startAt);
      }
    );
  }
function (callback) {
    IdentityCounter.findOneAndUpdate(
      { model: settings.model, field: settings.field },
      { count: settings.startAt - settings.incrementBy },
      { new: true }, // new: true specifies that the callback should get the updated counter.
      function (err) {
        if (err) return callback(err);
        callback(null, settings.startAt);
      }
    );
  }
function ( callback ) { IdentityCounter . findOneAndUpdate ( { model : settings . model , field : settings . field } , { count : settings . startAt - settings . incrementBy } , { new : true } , // new: true specifies that the callback should get the updated counter. function ( err ) { if ( err ) return callback ( err ) ; callback ( null , settings . startAt ) ; } ) ; }
Declare a function to reset counter at the start value - increment value.
Declare a function to reset counter at the start value - increment value .