@sprucelabs/chroma-data-store 0.2.1 → 0.2.2

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.
@@ -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.1",
16
+ "version": "0.2.2",
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/",