mirror of
https://github.com/mainnika/mongox-go-driver.git
synced 2026-07-03 17:22:33 +00:00
Invoke onclose at the end of an array deleting
This commit is contained in:
@@ -52,6 +52,8 @@ func (d *Database) DeleteArray(target interface{}, filters ...interface{}) (err
|
|||||||
|
|
||||||
composed.And(primitive.M{"_id": primitive.M{"$in": ids}})
|
composed.And(primitive.M{"_id": primitive.M{"$in": ids}})
|
||||||
|
|
||||||
|
defer composed.OnClose().Invoke(ctx, target)
|
||||||
|
|
||||||
result, err := collection.DeleteMany(ctx, composed.M(), opts)
|
result, err := collection.DeleteMany(ctx, composed.M(), opts)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user