Document Delete
The Model.OnDelete
method allows you to listen to when a document corresponding to the model is deleted in the database.
Usage
CastleModel.OnDelete(func(castleId primitive.ObjectID) {
fmt.Println("Castle deleted", castleId)
})
The Model.OnDelete
method allows you to listen to when a document corresponding to the model is deleted in the database.
CastleModel.OnDelete(func(castleId primitive.ObjectID) {
fmt.Println("Castle deleted", castleId)
})