Skip to content

Commit

Permalink
Merge pull request #5 from wajox/feature/use-time-for-created-update-…
Browse files Browse the repository at this point in the history
…at-fields

do not update timestamps if they are empty
  • Loading branch information
ildarusmanov authored Mar 9, 2022
2 parents 15f18e1 + 94e52bd commit b00506b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions base_document.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
// BaseDocument
type BaseDocument struct {
ID primitive.ObjectID `json:"id,omitempty" bson:"_id,omitempty"`
CreatedAt time.Time `json:"created_at" bson:"created_at"`
UpdatedAt time.Time `json:"updated_at" bson:"updated_at"`
CreatedAt time.Time `json:"created_at" bson:"created_at,omitempty"`
UpdatedAt time.Time `json:"updated_at" bson:"updated_at,omitempty"`
}

// GetID() returns ID of the document
Expand Down

0 comments on commit b00506b

Please sign in to comment.