ObjectId base might be empty

This commit is contained in:
Nikita Tokarchuk
2018-12-20 01:49:33 +01:00
parent e8cd680cde
commit b4d4fc666e
2 changed files with 13 additions and 1 deletions
+4 -1
View File
@@ -1,12 +1,15 @@
package base
import (
"github.com/mainnika/mongox-go-driver/mongox"
"github.com/mongodb/mongo-go-driver/bson/primitive"
)
var _ mongox.BaseObjectID = &ObjectID{}
// ObjectID is a structure with objectId as an _id field
type ObjectID struct {
ID primitive.ObjectID `bson:"_id" json:"_id"`
ID primitive.ObjectID `bson:"_id,omitempty" json:"_id,omitempty"`
}
// GetID returns an _id