Skip to content

Commit a9f34e9

Browse files
fix: removeMany should not throw an error if deleteCount equal 0 to keep same behavior between mongoose v5 and v6 (#416)
1 parent c1ea275 commit a9f34e9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/resolvers/removeMany.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export function removeMany<TSource = any, TContext = any, TDoc extends Document
9494

9595
const res = await beforeQueryHelper(resolveParams);
9696

97-
if (res.deletedCount) {
97+
if (typeof res.deletedCount === 'number') {
9898
// mongoose v6
9999
return {
100100
numAffected: res.deletedCount,

0 commit comments

Comments
 (0)