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.
23 lines
451 B
23 lines
451 B
package base
|
|
|
|
import (
|
|
"github.com/mainnika/mongox-go-driver/mongox"
|
|
"go.mongodb.org/mongo-driver/bson/primitive"
|
|
)
|
|
|
|
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
|
|
}
|
|
|