parent
bbbdf1a6ec
commit
5a3ee358b5
@ -0,0 +1,23 @@ |
|||||||
|
package base |
||||||
|
|
||||||
|
import ( |
||||||
|
"github.com/mainnika/mongox-go-driver/mongox" |
||||||
|
"github.com/mongodb/mongo-go-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 |
||||||
|
} |
Loading…
Reference in new issue