Answers for "mongoose get value"

0

mongoose get value

var Model = mongoose.model('Model', new mongoose.Schema({}))
Model.find({user_id: '1234'}, function(err, obj) {   
    console.log(obj[0].user_id)  // undefined                   
    console.log(obj[0].toObject().user_id)  // 1234     
})
Posted by: Guest on September-27-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language