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.
22 lines
392 B
22 lines
392 B
package stringbased
|
|
|
|
import (
|
|
"github.com/mainnika/mongox-go-driver/v2/mongox"
|
|
)
|
|
|
|
var _ mongox.StringBased = (*Primary)(nil)
|
|
|
|
// Primary is a structure with string as an _id field
|
|
type Primary struct {
|
|
ID string `bson:"_id" json:"_id"`
|
|
}
|
|
|
|
// GetID returns an _id
|
|
func (p *Primary) GetID() (id string) {
|
|
return p.ID
|
|
}
|
|
|
|
// SetID sets an _id
|
|
func (p *Primary) SetID(id string) {
|
|
p.ID = id
|
|
}
|
|
|