SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
fix(mongodb): merge URI auth fields with username/password override (#9889)
Chris Lu7aba10fa1adf
diff --git a/weed/filer/mongodb/mongodb_store.go b/weed/filer/mongodb/mongodb_store.goindex f87878f085..cbdfe7f549 100644--- a/weed/filer/mongodb/mongodb_store.go+++ b/weed/filer/mongodb/mongodb_store.go@@ -74,10 +74,15 @@ func (store *MongodbStore) connection(uri string, poolSize uint64, ssl bool, ssl}if username != "" && password != "" {- creds := options.Credential{- Username: username,- Password: password,+ // Keep auth fields parsed from the URI (AuthSource, AuthMechanism, ...)+ // and only override the credentials.+ creds := options.Credential{}+ if opts.Auth != nil {+ creds = *opts.Auth}+ creds.Username = username+ creds.Password = password+ creds.PasswordSet = trueopts.SetAuth(creds)}