@sprucelabs/chroma-data-store 0.2.1 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/ChromaDatabase.js
CHANGED
|
@@ -357,6 +357,9 @@ class ChromaDatabase {
|
|
|
357
357
|
}
|
|
358
358
|
async delete(collection, query) {
|
|
359
359
|
const matches = await this.find(collection, query);
|
|
360
|
+
if (matches.length === 0) {
|
|
361
|
+
return 0;
|
|
362
|
+
}
|
|
360
363
|
const col = await this.getCollection(collection);
|
|
361
364
|
await col.delete({
|
|
362
365
|
ids: matches.map((m) => m.id),
|
|
@@ -408,6 +408,9 @@ export default class ChromaDatabase {
|
|
|
408
408
|
delete(collection, query) {
|
|
409
409
|
return __awaiter(this, void 0, void 0, function* () {
|
|
410
410
|
const matches = yield this.find(collection, query);
|
|
411
|
+
if (matches.length === 0) {
|
|
412
|
+
return 0;
|
|
413
|
+
}
|
|
411
414
|
const col = yield this.getCollection(collection);
|
|
412
415
|
yield col.delete({
|
|
413
416
|
ids: matches.map((m) => m.id),
|
package/package.json
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"sprucebot",
|
|
14
14
|
"sprucelabs"
|
|
15
15
|
],
|
|
16
|
-
"version": "0.2.
|
|
16
|
+
"version": "0.2.3",
|
|
17
17
|
"scripts": {
|
|
18
18
|
"build.ci": "yarn run build.tsc && yarn run build.resolve-paths && yarn run lint",
|
|
19
19
|
"build.copy-files": "mkdir -p build && rsync -avzq --exclude='*.ts' ./src/ ./build/",
|
|
@@ -39,7 +39,8 @@
|
|
|
39
39
|
"watch.build.dev": "tsc-watch --sourceMap --onCompilationComplete 'yarn run post.watch.build'",
|
|
40
40
|
"watch.rebuild": "yarn run clean.all && yarn install && yarn run watch.build.dev",
|
|
41
41
|
"watch.tsc": "tsc -w",
|
|
42
|
-
"start.chroma.docker": "./support/start_chroma_docker.sh"
|
|
42
|
+
"start.chroma.docker": "./support/start_chroma_docker.sh",
|
|
43
|
+
"generate.embeddings": "./support/generate_embeddings.sh"
|
|
43
44
|
},
|
|
44
45
|
"devDependencies": {
|
|
45
46
|
"@sprucelabs/esm-postbuild": "^6.0.540",
|