mongoos populate a ref
const storySchema = Schema({ authors: [{ type: Schema.Types.ObjectId, ref: 'Person' }], title: String }); // Later const story = await Story.findOne({ title: 'Casino Royale' }).populate('authors'); story.authors; // `[]`
Source: mongoosejs.com
MongoDB Populate
router.get("/pop", async function(req, res, next) { const user = await User.findOne({username: "Andrew"}).populate('posts'); res.json(user.posts); });