Skip to content

v2.2.0

Compare
Choose a tag to compare
@chenmingyong0423 chenmingyong0423 released this 08 Feb 07:22
· 24 commits to main since this release
e681e67

What's Changed

  • Aggregator Operator: Now supports registering Hooks, allowing you to insert custom logic before and after aggregation operations.
  • Hook/Plugin Types: Added hook types for before* and after* actions.
  • mongox.model: The mongox.model now includes the mongox:autoID tag for the ID field, enabling automatic generation of ID values.
  • mongox.Client Struct: Added a mongox.Client struct, which currently only creates Database objects. More features, such as transaction handling, will be added in future versions.
  • mongox.Database Struct: Introduced the mongox.Database struct to support registering global plugins. This allows you to insert custom logic before and after database operations, enhancing the scalability and maintainability of applications.
  • mongox.NewCollection: Updated the signature of the mongox.NewCollection method, which now requires a mongox.Database object.
  • Model Field Hook Refactor: Moved the model field hook to the internal package and refactored it to support struct tagging, automatically filling field values during document insertion and updates. This reduces redundant code and improves maintainability and readability.
  • Global Plugin Registration: Removed the ability to register plugins globally; plugins must now be registered on the mongox.Database object.
  • Validation Hooks: Removed the validation struct validation hooks.
  • Plugin Initialization Function: Removed the mongox.InitPlugin function.

More Details: v2.2.0 changelog