Can't add a new property to an object returned by Mongoose query [duplicate]
问题 This question already has answers here : Why can't you modify the data returned by a Mongoose Query (ex: findById) (2 answers) Closed 5 years ago . I'm coding an API with Node.js, MongoDB and Express. I can't seem to add a new property to the location objects I'm iterating through. I don't understand the issue with my code at all. loc is a plain object, it should work. Am I wrong? // ********************************** // GET Locations // ********************************** // Create endpoint