Mongoose/MongoDB result fields appear undefined in Javascript
Solution You can call the toObject method in order to access the fields. For example: var itemObject = item.toObject(); console.log(itemObject.title); // “foo” Why As you point out that the real fields are stored in the _doc field of the document. But why console.log(item) => { title: “foo”, content: “bar” }? From the source code of … Read more