You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Declare a model with DefaultModel
type Book struct {
// DefaultModel add _id,created_at and updated_at fields to the Model
mgm.DefaultModel bson:",inline"
Name string json:"name" bson:"name"
Pages int json:"pages" bson:"pages"
}
Insert a document to the DB using this model with Collection.InsertOne or Collection.InsertMany functions
3 Check created_at value of the inserted document
4.Its written as 0001-01-01T00:00:00.000+00:00
Expected behaviour
It should actually write 2020-06-12T05:45:56.598+00:00
Environment (please complete the following information):
OS: [ubuntu 18.04]
The text was updated successfully, but these errors were encountered:
Elcomerz
changed the title
DefaultModel CreatedAt and UpdatedAt fields saving wrong time value instead of actual one.
DefaultModel CreatedAt and UpdatedAt fields saving wrong time value instead of actual one when creating documents with InsertOne and InsertMany functions
Jun 12, 2020
Elcomerz
changed the title
DefaultModel CreatedAt and UpdatedAt fields saving wrong time value instead of actual one when creating documents with InsertOne and InsertMany functions
DefaultModel CreatedAt and UpdatedAt fields saving wrong time value when creating documents with InsertOne and InsertMany functions
Jun 12, 2020
Mongo Go Models does not support webhook call on all of the collection methods.
Check mgm docs in README.md file please:
collection's methods which call to the hooks:
Create & CreateWithCtx
Update & UpdateWithCtx
Delete & DeleteWithCtx
mehran-prs
changed the title
DefaultModel CreatedAt and UpdatedAt fields saving wrong time value when creating documents with InsertOne and InsertMany functions
DefaultModel CreatedAt and UpdatedAt fields saving wrong time on native methods
Jun 13, 2020
Describe the bug
To Reproduce
Steps to reproduce the behaviour:
Declare a model with DefaultModel
type Book struct {
// DefaultModel add _id,created_at and updated_at fields to the Model
mgm.DefaultModel
bson:",inline"
Name string
json:"name" bson:"name"
Pages int
json:"pages" bson:"pages"
}
Insert a document to the DB using this model with Collection.InsertOne or Collection.InsertMany functions
3 Check created_at value of the inserted document
4.Its written as 0001-01-01T00:00:00.000+00:00
Expected behaviour
It should actually write 2020-06-12T05:45:56.598+00:00
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: