Browse Source

fixed bson/ObjectId

tags/0.2
Xing Xing 11 years ago
parent
commit
2002bb1804
1 changed files with 3 additions and 5 deletions
  1. +3
    -5
      client/id.go

+ 3
- 5
client/id.go View File

@@ -11,16 +11,14 @@ type IdGenerator interface {
} }


// ObjectId // ObjectId
type objectId struct {
bson.ObjectId
}
type objectId struct {}


func (id *objectId) Id() string { func (id *objectId) Id() string {
return id.Hex()
return bson.NewObjectId().Hex()
} }


func NewObjectId() IdGenerator { func NewObjectId() IdGenerator {
return &objectId{bson.NewObjectId()}
return &objectId{}
} }


// AutoIncId // AutoIncId


Loading…
Cancel
Save