ess-etl-go/pkg/adapter/repository/mongodb/object_id.go

12 lines
238 B
Go

package mongodb
import "go.mongodb.org/mongo-driver/bson/primitive"
func MustObjectID(id string) primitive.ObjectID {
objectID, err := primitive.ObjectIDFromHex(id)
if err != nil {
return primitive.NilObjectID
}
return objectID
}