diff --git a/internal/rootcoord/show_collection_task.go b/internal/rootcoord/show_collection_task.go index a8b509a589..563057eada 100644 --- a/internal/rootcoord/show_collection_task.go +++ b/internal/rootcoord/show_collection_task.go @@ -19,6 +19,8 @@ package rootcoord import ( "context" + "github.com/samber/lo" + "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" "github.com/milvus-io/milvus/pkg/util/merr" @@ -53,6 +55,10 @@ func (t *showCollectionTask) Execute(ctx context.Context) error { return err } for _, coll := range colls { + if len(t.Req.GetCollectionNames()) > 0 && !lo.Contains(t.Req.GetCollectionNames(), coll.Name) { + continue + } + t.Rsp.CollectionNames = append(t.Rsp.CollectionNames, coll.Name) t.Rsp.CollectionIds = append(t.Rsp.CollectionIds, coll.CollectionID) t.Rsp.CreatedTimestamps = append(t.Rsp.CreatedTimestamps, coll.CreateTime)