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.
25 lines
445 B
25 lines
445 B
5 years ago
|
package jsonbased
|
||
|
|
||
|
import (
|
||
|
"go.mongodb.org/mongo-driver/bson/primitive"
|
||
|
|
||
|
"github.com/mainnika/mongox-go-driver/v2/mongox"
|
||
|
)
|
||
|
|
||
|
var _ mongox.JSONBased = (*Primary)(nil)
|
||
|
|
||
|
// Primary is a structure with object as an _id field
|
||
|
type Primary struct {
|
||
|
ID primitive.D `bson:"_id" json:"_id"`
|
||
|
}
|
||
|
|
||
|
// GetID returns an _id
|
||
|
func (p *Primary) GetID() primitive.D {
|
||
|
return p.ID
|
||
|
}
|
||
|
|
||
|
// SetID sets an _id
|
||
|
func (p *Primary) SetID(id primitive.D) {
|
||
|
p.ID = id
|
||
|
}
|