Automattic / Automattic/mongoose

Pass result to query.post() hooks

Open
#15,899 0 comments 0 reactions 0 assignees View on GitHub
backwards-breaking enhancement
Dominant language
JavaScript
Stars
27.5k
Forks
4k
Avg merge
2d 7h
Merged PRs (30d)
35

Description

### Prerequisites

- [x] I have written a descriptive issue title
- [x] I have searched existing issues to ensure the feature has not already been requested

### 🚀 Feature Proposal

Re: https://github.com/Automattic/mongoose/pull/15898, `query.post()` hooks should receive the query result as a parameter:

```javascript
query.post(function(result) {
if (result.deletedCount > 0) {
// Handle successful delete
}
});
```

### Motivation

_No response_

### Example

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by tracing the query.post() hook handling and review the behavior discussed in pull request #15898. The change is complete when post hooks receive the query result, including result.deletedCount for delete operations, with coverage for the new callback argument.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, mongodb, nodejs
Domain
backend, database
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.