Comparing version 7.12.2 to 7.12.3
@@ -462,8 +462,17 @@ 'use strict'; | ||
const isSingle = (typeof criteria !== 'object'); | ||
const selection = (isSingle ? this.raw.get(criteria) | ||
: (Array.isArray(criteria) ? this.raw.getAll(RethinkDB.args(criteria)) | ||
: this.raw.filter(criteria))); | ||
const diag = { criteria }; | ||
const diag = { criteria }; | ||
const isBatch = Array.isArray(criteria); | ||
const isIds = (isBatch || typeof criteria !== 'object' || criteria.id !== undefined); | ||
if (isIds) { | ||
criteria = Id.normalize(criteria, true); | ||
if (criteria instanceof Error) { | ||
return this._error('remove', criteria.message, diag, Hoek.nextTick(callback)); | ||
} | ||
} | ||
const selection = (!isIds ? this.raw.filter(criteria) | ||
: (isBatch ? this.raw.getAll(RethinkDB.args(criteria)) | ||
: this.raw.get(criteria))); | ||
this._run(selection.delete(), 'remove', diag, (err, result) => { | ||
@@ -475,3 +484,4 @@ | ||
if (isSingle && | ||
if (isIds && | ||
!isBatch && | ||
!result.deleted) { | ||
@@ -478,0 +488,0 @@ |
{ | ||
"name": "penseur", | ||
"description": "Lightweight RethinkDB wrapper", | ||
"version": "7.12.2", | ||
"version": "7.12.3", | ||
"author": "Eran Hammer <eran@hammer.io> (http://hueniverse.com)", | ||
@@ -6,0 +6,0 @@ "repository": "git://github.com/hueniverse/penseur", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
75608
1740