diff --git a/audit.go b/audit.go index c5c5aec..f8dbb1a 100644 --- a/audit.go +++ b/audit.go @@ -12,11 +12,11 @@ const ( type AuditResult struct { Op Op `bson:"op" json:"op"` - Entity string `bson:"entity" json:"entity"` - Data any `bson:"data" json:"data"` - Before any `bson:"before" json:"before"` - After any `bson:"after" json:"after"` - Context any `bson:"context" json:"context"` + Entity string `bson:"entity,omitempty" json:"entity,omitempty"` + Data any `bson:"data,omitempty" json:"data,omitempty",` + Before any `bson:"before,omitempty" json:"before,omitempty"` + After any `bson:"after,omitempty" json:"after,omitempty"` + Context any `bson:"context,omitempty" json:"context,omitempty"` } type OnAudit func(audit *AuditResult) error \ No newline at end of file