Answer the question
In order to leave comments, you need to log in
Is there a way to optimize this approach?
Good day.
I have a user collection and related collections like emailConfirmation which refers to user.
I mean emailConfirmationModel:
userId: {
type: Schema.Types.ObjectId,
ref: 'User',
},
const user = await User.findOne...
const userConfirmationInfo = await emailConfirmation.findOne...
const data = { ...user, ...userConfirmationInfo };
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question