When you return Mongoose documents from the MongoDB database, you cannot just edit the returned document. You need to either convert it to a regular JavaScript object using a function .toObject()that doesn't work for me yet - or JSON.parse(JSON.stringify(doc))it,
My question is: why is this so? Why don't they just return as simple, simple, and easy to use default JavaScript objects?
source
share