fixed bson/ObjectId

This commit is contained in:
Xing Xing 2013-08-07 15:30:41 +08:00
parent e7d32edee0
commit 2002bb1804

View File

@ -11,16 +11,14 @@ type IdGenerator interface {
} }
// ObjectId // ObjectId
type objectId struct { type objectId struct {}
bson.ObjectId
}
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