Skip to content

Commit ab7f76f

Browse files
committed
Rework test
1 parent 81be74e commit ab7f76f

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/test/11-managing-indexes.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,11 @@ describe("Managing indexes", function () {
8383
});
8484
describe("collection.ensureIndex#vector", () => {
8585
it31205("should create a vector index", async () => {
86-
await collection.save({
87-
_key: "sample1",
88-
embedding: Array(128).fill(0.1),
89-
});
90-
await collection.save({
91-
_key: "sample2",
92-
embedding: Array(128).fill(0.1),
93-
});
86+
const data = Array.from({ length: 128 }, (_, cnt) => ({
87+
_key: `vec${cnt}`,
88+
embedding: Array(128).fill(cnt),
89+
}));
90+
await collection.import(data);
9491
const info = await collection.ensureIndex({
9592
type: "vector",
9693
fields: ["embedding"],

0 commit comments

Comments
 (0)