Skip to content

Commit f2dc64b

Browse files
fix(model): add omitempty tag to DeletedAt field for BSON serialization (#74)
1 parent cbbce77 commit f2dc64b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

model.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ type Model struct {
3434
ID bson.ObjectID `bson:"_id,omitempty"`
3535
CreatedAt time.Time `bson:"created_at"`
3636
UpdatedAt time.Time `bson:"updated_at"`
37-
DeletedAt time.Time `bson:"deleted_at"`
37+
DeletedAt time.Time `bson:"deleted_at,omitempty"`
3838
}
3939

4040
func (m *Model) DefaultId() bson.ObjectID {

0 commit comments

Comments
 (0)