Skip to content

Commit

Permalink
Fix issue graphql-compose#415: removeMany should not throw an error i…
Browse files Browse the repository at this point in the history
…f deleteCount equal 0 to keep same behavior between mongoose v5 and v6
  • Loading branch information
francois-spectre committed Sep 21, 2022
1 parent c1ea275 commit 3a81ff2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/resolvers/removeMany.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export function removeMany<TSource = any, TContext = any, TDoc extends Document

const res = await beforeQueryHelper(resolveParams);

if (res.deletedCount) {
if (typeof res.deletedCount === 'number') {
// mongoose v6
return {
numAffected: res.deletedCount,
Expand Down

0 comments on commit 3a81ff2

Please sign in to comment.