casbin / mongodb-adapter

MongoDB adapter for Casbin

Home Page:https://github.com/casbin/casbin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bsonx.Doc need to chang to use bson.D

Candy-Hixcare opened this issue · comments

in adaper.go

	keysDoc := bsonx.Doc{}

	for _, k := range indexes {
		keysDoc = keysDoc.Append(k, bsonx.Int32(1))
	}

	if _, err = collection.Indexes().CreateOne(
		context.Background(),
		mongo.IndexModel{
			Keys:    keysDoc,
			Options: options.Index().SetUnique(true),
		},
	); err != nil {
		return err
	}

bsonx.Doc not exist any more

https://www.mongodb.com/docs/drivers/go/current/fundamentals/indexes/

mongo document update to use bson.D

@Candy-Hixcare hi, can you make a PR to fix it?

@hsluoyz ok, but I will change another account. I use'd wrong account :P
and than, I never use casbin may use more time :O