Automattic / Automattic/mongoose

populate from one path to a different path

Open
#9,034 8 comments 5 reactions 0 assignees View on GitHub
new feature
Dominant language
JavaScript
Stars
27.5k
Forks
4k
Avg merge
2d 7h
Merged PRs (30d)
35

Description

On populating documents, it would be great if we could assign the populated result to a different field, akin to how `$lookup` works.
```js
const post = await Post.findOne().populate({ path: 'userId', as: 'user' });
```

Contributor guide

Open the contributing guide

Research direction

Start with Mongoose's populate API and the `$lookup` behavior referenced in the issue, then locate the existing populate implementation and related tests. Done means the requested `userId` population can expose its result through the separate `user` field, with behavior and edge cases covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, mongodb
Domain
database
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.