aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2023-07-24 11:09:51 -0700
committerchrislu <chris.lu@gmail.com>2023-07-24 11:09:51 -0700
commitc09100f928466116fa648474417e30540026d8a4 (patch)
treec35bb31f761b22929b74d0593479ebc2bbdf9b8a
parenta69be6fd3e96247d81bc540e6039671799341ceb (diff)
downloadseaweedfs-c09100f928466116fa648474417e30540026d8a4.tar.xz
seaweedfs-c09100f928466116fa648474417e30540026d8a4.zip
fix building mongo index
-rw-r--r--weed/filer/mongodb/mongodb_store.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/weed/filer/mongodb/mongodb_store.go b/weed/filer/mongodb/mongodb_store.go
index 49190058b..8ebbc6ab0 100644
--- a/weed/filer/mongodb/mongodb_store.go
+++ b/weed/filer/mongodb/mongodb_store.go
@@ -10,7 +10,6 @@ import (
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/mongo/options"
- "go.mongodb.org/mongo-driver/x/bsonx"
"time"
)
@@ -72,7 +71,7 @@ func (store *MongodbStore) indexUnique(c *mongo.Collection) error {
*unique = true
index := mongo.IndexModel{
- Keys: bsonx.Doc{{Key: "directory", Value: bsonx.Int32(1)}, {Key: "name", Value: bsonx.Int32(1)}},
+ Keys: bson.D{{Key: "directory", Value: int32(1)}, {Key: "name", Value: int32(1)}},
Options: &options.IndexOptions{
Unique: unique,
},