Skip to content
MilvusNode SDK
Sections

Milvus Node.js SDK

Markdown

Copy for agent

@zilliz/milvus2-sdk-node v3.x is the official Node.js SDK for compatible Milvus 2.x and 3.0+ deployments and Zilliz Cloud, with MilvusClient for gRPC and HttpClient for REST v2.

npm
npm install @zilliz/milvus2-sdk-node
list-collections.mjs
import { MilvusClient } from '@zilliz/milvus2-sdk-node';
const client = new MilvusClient({
address: process.env.MILVUS_ADDRESS ?? 'localhost:19530',
token: process.env.MILVUS_TOKEN,
});
try {
const { status, data } = await client.listCollections();
if (status.error_code !== 'Success') throw new Error(status.reason);
console.log(data.map((collection) => collection.name));
} finally {
await client.closeConnection();
}

Run node list-collections.mjs against local Milvus, or set MILVUS_ADDRESS and MILVUS_TOKEN for your cluster.