You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mongox-go-driver/mongox/base/object.go

24 lines
451 B

6 years ago
package base
import (
"github.com/mainnika/mongox-go-driver/mongox"
"go.mongodb.org/mongo-driver/bson/primitive"
6 years ago
)
var _ mongox.BaseObject = &Object{}
// Object is a structure with object as an _id field
type Object struct {
ID primitive.D `bson:"_id,omitempty" json:"_id,omitempty"`
}
// GetID returns an _id
func (db *Object) GetID() primitive.D {
return db.ID
}
// SetID sets an _id
func (db *Object) SetID(id primitive.D) {
db.ID = id
}