Supported container runtimes
Qdrant
登录后可跨设备保存划线和私人笔记登录
Qdrant
Install
1npm install @testcontainers/qdrant --save-devExamples
These examples use the following libraries:
-
1npm install @qdrant/js-client-rest
Choose an image from the container registry and substitute IMAGE.
Fetch collections
1
2
3
4
5await 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
1
2
3
4
5const 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
1
2
3
4
5await 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" });评论
登录后参与评论
正在加载评论…
KnowForge