Invoke onclose at the end of an array deleting

This commit is contained in:
Nikita Tokarchuk
2020-07-22 04:45:32 +02:00
parent 73dc4974a2
commit 50e947b203
+2
View File
@@ -52,6 +52,8 @@ func (d *Database) DeleteArray(target interface{}, filters ...interface{}) (err
composed.And(primitive.M{"_id": primitive.M{"$in": ids}})
defer composed.OnClose().Invoke(ctx, target)
result, err := collection.DeleteMany(ctx, composed.M(), opts)
if err != nil {
return