Qdrant
Install
| npm install @testcontainers/qdrant --save-dev
|
Examples
These examples use the following libraries:
Choose an image from the container registry and substitute IMAGE
.
Fetch collections
| await using container = await new QdrantContainer(IMAGE).start();
const client = new QdrantClient({ url: `http://${container.getRestHostAddress()}` });
expect((await client.getCollections()).collections.length).toBe(0);
|
With API key
| const apiKey = crypto.randomUUID();
await using container = await new QdrantContainer(IMAGE).withApiKey(apiKey).start();
const client = new QdrantClient({ url: `http://${container.getRestHostAddress()}`, apiKey });
|
With config file
| await using container = await new QdrantContainer(IMAGE)
.withConfigFile(path.resolve(__dirname, "test_config.yaml"))
.start();
const client = new QdrantClient({ url: `http://${container.getRestHostAddress()}`, apiKey: "SOME_TEST_KEY" });
|