You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The .transform function should be executed only once.
Example of error occured:
constname=awaitUser.findById(user._id).transform((doc)=>{returndoc!.name})console.log(name)// Should display user's name but it's undefined (= user.name.name)
The text was updated successfully, but these errors were encountered:
Prerequisites
Mongoose version
8.0.3
Node.js version
20.10.0
MongoDB server version
5.0.4
Typescript version (if applicable)
5.3.3
Description
The
.transform
function when using.findOne
is executed twice instead of once.Steps to Reproduce
Expected Behavior
The
.transform
function should be executed only once.Example of error occured:
The text was updated successfully, but these errors were encountered: