-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Milvus-doc-bot
authored and
Milvus-doc-bot
committed
Dec 23, 2024
1 parent
be4ecf2
commit 4f01d2f
Showing
2 changed files
with
7 additions
and
3 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
localization/v2.5.x/site/en/userGuide/collections/modify-collection.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"codeList":["from pymilvus import MilvusClient\n\nclient = MilvusClient(\n uri=\"http://localhost:19530\",\n token=\"root:Milvus\"\n)\n\nclient.rename_collection(\n old_name=\"my_collection\",\n new_name=\"my_new_collection\"\n)\n\n","import io.milvus.v2.service.collection.request.RenameCollectionReq;\nimport io.milvus.v2.client.ConnectConfig;\nimport io.milvus.v2.client.MilvusClientV2;\n\nString CLUSTER_ENDPOINT = \"http://localhost:19530\";\nString TOKEN = \"root:Milvus\";\n\n// 1. Connect to Milvus server\nConnectConfig connectConfig = ConnectConfig.builder()\n .uri(CLUSTER_ENDPOINT)\n .token(TOKEN)\n .build();\n \nMilvusClientV2 client = new MilvusClientV2(connectConfig);\n\nRenameCollectionReq renameCollectionReq = RenameCollectionReq.builder()\n .collectionName(\"my_collection\")\n .newCollectionName(\"my_new_collection\")\n .build();\n\nclient.renameCollection(renameCollectionReq);\n\n","import { MilvusClient, DataType } from \"@zilliz/milvus2-sdk-node\";\n\nconst address = \"http://localhost:19530\";\nconst token = \"root:Milvus\";\nconst client = new MilvusClient({address, token});\n\nconst res = await client.renameCollection({\n oldName: \"my_collection\",\n newName: \"my_new_collection\"\n});\n\n","import (\n \"context\"\n \"fmt\"\n \"log\"\n\n \"github.com/milvus-io/milvus/client/v2\"\n)\n\nctx, cancel := context.WithCancel(context.Background())\ndefer cancel()\n\nmilvusAddr := \"127.0.0.1:19530\"\ntoken := \"root:Milvus\"\n\ncli, err := client.New(ctx, &client.ClientConfig{\n Address: milvusAddr,\n APIKey: token,\n})\nif err != nil {\n log.Fatal(\"failed to connect to milvus server: \", err.Error())\n}\n\ndefer cli.Close(ctx)\n\nerr = cli.RenameCollection(ctx, client.NewRenameCollectionOption(\"my_collection\", \"my_new_collection\"))\nif err != nil {\n // handle error\n}\n\n","export CLUSTER_ENDPOINT=\"http://localhost:19530\"\nexport TOKEN=\"root:Milvus\"\n\ncurl --request POST \\\n--url \"${CLUSTER_ENDPOINT}/v2/vectordb/collections/rename\" \\\n--header \"Authorization: Bearer ${TOKEN}\" \\\n--header \"Content-Type: application/json\" \\\n-d '{\n \"collectionName\": \"my_collection\",\n \"newCollectionName\": \"my_new_collection\"\n}'\n\n","# Currently not available for Python\n\n","import io.milvus.v2.service.collection.request.AlterCollectionReq;\nimport java.util.HashMap;\nimport java.util.Map;\n\nMap<String, String> properties = new HashMap<>();\nproperties.put(\"collection.ttl.seconds\", \"60\");\n\nAlterCollectionReq alterCollectionReq = AlterCollectionReq.builder()\n .collectionName(\"my_collection\")\n .properties(properties)\n .build();\n\nclient.alterCollection(alterCollectionReq);\n\n","res = await client.alterCollection({\n collection_name: \"my_collection\",\n properties: {\n \"collection.ttl.seconds\": 60\n }\n})\n\n","import (\n \"context\"\n \"fmt\"\n \"log\"\n\n \"github.com/milvus-io/milvus/client/v2\"\n \"github.com/milvus-io/milvus/pkg/common\"\n)\n\n\nctx, cancel := context.WithCancel(context.Background())\ndefer cancel()\n\nmilvusAddr := \"127.0.0.1:19530\"\ntoken := \"root:Milvus\"\n\ncli, err := client.New(ctx, &client.ClientConfig{\n Address: milvusAddr,\n APIKey: token,\n})\nif err != nil {\n log.Fatal(\"failed to connect to milvus server: \", err.Error())\n}\n\ndefer cli.Close(ctx)\n\nerr = cli.AlterCollection(ctx, client.NewAlterCollectionOption(\"my_collection\").WithProperty(common.CollectionTTLConfigKey, 60))\nif err != nil {\n // handle error\n}\n\n","# Currently not available for REST\n\n"],"headingContent":"Modify Collection","anchorList":[{"label":"Modify Collection","href":"Modify-Collection","type":1,"isActive":false},{"label":"Rename Collection","href":"Rename-Collection","type":2,"isActive":false},{"label":"Set Collection TTL","href":"Set-Collection-TTL","type":2,"isActive":false}]} | ||
{"codeList":["from pymilvus import MilvusClient\n\nclient = MilvusClient(\n uri=\"http://localhost:19530\",\n token=\"root:Milvus\"\n)\n\nclient.rename_collection(\n old_name=\"my_collection\",\n new_name=\"my_new_collection\"\n)\n\n","import io.milvus.v2.service.collection.request.RenameCollectionReq;\nimport io.milvus.v2.client.ConnectConfig;\nimport io.milvus.v2.client.MilvusClientV2;\n\nString CLUSTER_ENDPOINT = \"http://localhost:19530\";\nString TOKEN = \"root:Milvus\";\n\n// 1. Connect to Milvus server\nConnectConfig connectConfig = ConnectConfig.builder()\n .uri(CLUSTER_ENDPOINT)\n .token(TOKEN)\n .build();\n \nMilvusClientV2 client = new MilvusClientV2(connectConfig);\n\nRenameCollectionReq renameCollectionReq = RenameCollectionReq.builder()\n .collectionName(\"my_collection\")\n .newCollectionName(\"my_new_collection\")\n .build();\n\nclient.renameCollection(renameCollectionReq);\n\n","import { MilvusClient, DataType } from \"@zilliz/milvus2-sdk-node\";\n\nconst address = \"http://localhost:19530\";\nconst token = \"root:Milvus\";\nconst client = new MilvusClient({address, token});\n\nconst res = await client.renameCollection({\n oldName: \"my_collection\",\n newName: \"my_new_collection\"\n});\n\n","import (\n \"context\"\n \"fmt\"\n \"log\"\n\n \"github.com/milvus-io/milvus/client/v2\"\n)\n\nctx, cancel := context.WithCancel(context.Background())\ndefer cancel()\n\nmilvusAddr := \"127.0.0.1:19530\"\ntoken := \"root:Milvus\"\n\ncli, err := client.New(ctx, &client.ClientConfig{\n Address: milvusAddr,\n APIKey: token,\n})\nif err != nil {\n log.Fatal(\"failed to connect to milvus server: \", err.Error())\n}\n\ndefer cli.Close(ctx)\n\nerr = cli.RenameCollection(ctx, client.NewRenameCollectionOption(\"my_collection\", \"my_new_collection\"))\nif err != nil {\n // handle error\n}\n\n","export CLUSTER_ENDPOINT=\"http://localhost:19530\"\nexport TOKEN=\"root:Milvus\"\n\ncurl --request POST \\\n--url \"${CLUSTER_ENDPOINT}/v2/vectordb/collections/rename\" \\\n--header \"Authorization: Bearer ${TOKEN}\" \\\n--header \"Content-Type: application/json\" \\\n-d '{\n \"collectionName\": \"my_collection\",\n \"newCollectionName\": \"my_new_collection\"\n}'\n\n","from pymilvus import MilvusClient\n\nclient.alter_collection_properties(\n collection_name=\"collection_name\",\n properties = {\"collection.ttl.seconds\": 500}\n)\n","import io.milvus.v2.service.collection.request.AlterCollectionReq;\nimport java.util.HashMap;\nimport java.util.Map;\n\nMap<String, String> properties = new HashMap<>();\nproperties.put(\"collection.ttl.seconds\", \"60\");\n\nAlterCollectionReq alterCollectionReq = AlterCollectionReq.builder()\n .collectionName(\"my_collection\")\n .properties(properties)\n .build();\n\nclient.alterCollection(alterCollectionReq);\n\n","res = await client.alterCollection({\n collection_name: \"my_collection\",\n properties: {\n \"collection.ttl.seconds\": 60\n }\n})\n\n","import (\n \"context\"\n \"fmt\"\n \"log\"\n\n \"github.com/milvus-io/milvus/client/v2\"\n \"github.com/milvus-io/milvus/pkg/common\"\n)\n\n\nctx, cancel := context.WithCancel(context.Background())\ndefer cancel()\n\nmilvusAddr := \"127.0.0.1:19530\"\ntoken := \"root:Milvus\"\n\ncli, err := client.New(ctx, &client.ClientConfig{\n Address: milvusAddr,\n APIKey: token,\n})\nif err != nil {\n log.Fatal(\"failed to connect to milvus server: \", err.Error())\n}\n\ndefer cli.Close(ctx)\n\nerr = cli.AlterCollection(ctx, client.NewAlterCollectionOption(\"my_collection\").WithProperty(common.CollectionTTLConfigKey, 60))\nif err != nil {\n // handle error\n}\n\n","# Currently not available for REST\n\n"],"headingContent":"Modify Collection","anchorList":[{"label":"Modify Collection","href":"Modify-Collection","type":1,"isActive":false},{"label":"Rename Collection","href":"Rename-Collection","type":2,"isActive":false},{"label":"Set Collection TTL","href":"Set-Collection-TTL","type":2,"isActive":false}]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters