From 73087f59b1fd0cee675344a58445453744ff3d41 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Thu, 7 May 2020 03:11:26 -0700 Subject: [PATCH] filer store: mongodb deleting children fix https://github.com/chrislusf/seaweedfs/issues/1303 --- weed/filer2/mongodb/mongodb_store.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/weed/filer2/mongodb/mongodb_store.go b/weed/filer2/mongodb/mongodb_store.go index 63a7a43e4..375a457a4 100644 --- a/weed/filer2/mongodb/mongodb_store.go +++ b/weed/filer2/mongodb/mongodb_store.go @@ -159,7 +159,7 @@ func (store *MongodbStore) DeleteEntry(ctx context.Context, fullpath util.FullPa func (store *MongodbStore) DeleteFolderChildren(ctx context.Context, fullpath util.FullPath) error { where := bson.M{"directory": fullpath} - _, err := store.connect.Database(store.database).Collection(store.collectionName).DeleteOne(ctx, where) + _, err := store.connect.Database(store.database).Collection(store.collectionName).DeleteMany(ctx, where) if err != nil { return fmt.Errorf("delete %s : %v", fullpath, err) }