2
如何忽略查询中time
字段的默认值?
因为他们在0001-01-01 00:00:00 +0000 UTC
设置,我无法找到合适的文档如何使用自定义结构在mongo中搜索?
// User model
type User struct {
Mail string `json:"mail" bson:"mail,omitempty"`
Password string `json:"password" bson:"password,omitempty"`
CreatedAt time.Time `json:"created_at" bson:"created_at,omitempty"`
UpdatedAt time.Time `json:"updated_at" bson:"updated_at,omitempty"`
}
例https://play.golang.org/p/P2P30PPtl0