Skip to content
This repository has been archived by the owner on Jul 8, 2019. It is now read-only.

Releases: Alorel/mongoose-auto-increment-reworked

1.2.0

11 Feb 22:56
1.2.0
Compare
Choose a tag to compare
  • [feature]: Explicit initialisation is now optional. If initialise() is not called, the default 'IdCounter' collection will be used.
    • This also means that applyPlugin() will no longer throw if initialisation hasn't been performed yet.
  • [feature]: It's now possible to use the plugin via the schema: schema.plugin(MongooseAutoIncrementID.plugin, {modelName: 'MyModel'});
  • [documentation]: Several typos have been fixed.

1.1.0

25 Jan 01:41
1.1.0
f84dc5c
Compare
Choose a tag to compare
  • Feature: MongooseAutoIncrementID instances now have the following readonly properties:
    • isReady - Whether or not the initialisation has completed
    • promise - The promise returned by applyPlugin()
    • error - Error, if any, thrown by applyPlugin()
  • Feature: MongooseIncrementID now has the following static methods:
    • isReady(schema: Schema, modelName: string): boolean - Check if the given schema and model have finished their plugin initialisation
    • getErrorFor(schema: Schema, modelName: string): Error | undefined - Check if the given schema and model threw an error during initialisation
    • getPromiseFor(schema: Schema, modelName: string): Promise<void> | undefined - get the promise returned during initialisation for the given schema and model
  • Feature: getDefaults() static method added - returns the default options used by the plugin
  • Feature: setDefaults static method added - override the default options used by the plugin
  • 🔄 Refactor: nextCount and resetCount functions are now created during initialisation instead of getting cloned via .bind(this)

1.0.0

23 Jan 09:45
1.0.0
8be89dc
Compare
Choose a tag to compare

Initial release