-
-
Notifications
You must be signed in to change notification settings - Fork 51
Closed
Labels
Description
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