Skip to content

Conversation

@amirdaaee
Copy link
Contributor

following methods have been added to ICreator interface:

ModelHook(modelHook any) ICreator[T]
RegisterAfterHooks(hooks ...HookFn[T]) ICreator[T]
RegisterBeforeHooks(hooks ...HookFn[T]) ICreator[T]
GetCollection() *mongo.Collection

following methods have been added to IDeleter interface:

Filter(filter any) IDeleter[T]
ModelHook(modelHook any) IDeleter[T]
RegisterAfterHooks(hooks ...AfterHookFn) IDeleter[T]
RegisterBeforeHooks(hooks ...BeforeHookFn) IDeleter[T]
PostActionHandler(ctx context.Context, globalOpContext *operation.OpContext, opContext *OpContext, opType operation.OpType) error
PreActionHandler(ctx context.Context, globalOpContext *operation.OpContext, opContext *OpContext, opType operation.OpType) error
GetCollection() *mongo.Collection

following methods have been added to IFinder interface:

Distinct(ctx context.Context, fieldName string, opts ...options.Lister[options.DistinctOptions]) *mongo.DistinctResult
DistinctWithParse(ctx context.Context, fieldName string, result any, opts ...options.Lister[options.DistinctOptions]) error
Filter(filter any) IFinder[T]
FindOneAndUpdate(ctx context.Context, opts ...options.Lister[options.FindOneAndUpdateOptions]) (*T, error)
Limit(limit int64) IFinder[T]
ModelHook(modelHook any) IFinder[T]
RegisterAfterHooks(hooks ...AfterHookFn[T]) IFinder[T]
RegisterBeforeHooks(hooks ...BeforeHookFn[T]) IFinder[T]
Skip(skip int64) IFinder[T]
Sort(sort any) IFinder[T]
Updates(update any) IFinder[T]
PostActionHandler(ctx context.Context, globalOpContext *operation.OpContext, opContext *OpContext[T], opTypes ...operation.OpType) (err error)
PreActionHandler(ctx context.Context, globalOpContext *operation.OpContext, opContext *OpContext[T], opTypes ...operation.OpType) (err error)
GetCollection() *mongo.Collection

following methods have been added to IUpdater interface:

Filter(filter any) IUpdater[T]
ModelHook(modelHook any) IUpdater[T]
RegisterAfterHooks(hooks ...AfterHookFn) IUpdater[T]
RegisterBeforeHooks(hooks ...BeforeHookFn) IUpdater[T]
Replacement(replacement any) IUpdater[T]
Updates(updates any) IUpdater[T]
PostActionHandler(ctx context.Context, globalOpContext *operation.OpContext, opContext *OpContext, opType operation.OpType) error
PreActionHandler(ctx context.Context, globalOpContext *operation.OpContext, opContext *OpContext, opType operation.OpType) error
GetCollection() *mongo.Collection

furthermore, test files (*_test.go) have been separated from main packages

@chenmingyong0423
Copy link
Owner

Contribution Guide: https://go-mongox.dev/en/contribute.html.

Before submitting your code, you can run the make e2e command to ensure all tests pass.

@chenmingyong0423
Copy link
Owner

Nice, bro.

@chenmingyong0423 chenmingyong0423 merged commit 156bccb into chenmingyong0423:main Mar 22, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants