I am using NodeJs, ExpressJs with Mongodb and Mongoose. I want to select two document\'s value by user id.
I have three model User, Academic and Career. I have made a re
For what I've read in the docs, I think what you are looking for is something like so:
const career = await Career.find({ user: user._id});
const academics = await Academics.find({ user: user._id});
Or if you want to execute both queries at the same time:
const careerOperation = Career.find({ user: user._id});
const academicsOperation = Academics.find({ user: user._id});
const [
career,
academics
] = await Promise.all([career.exec(), academics.exec()]);
Hope to have helped!