mongoose.model.prototype.find
returns an array of objects found. If you type Array.prototype.name
in a console somewhere, you’ll get undefined
. Instead, use mongoose.model.prototype.findOne
.
CLICK HERE to find out more related problems solutions.