Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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     
})
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #mongoose
ADD COMMENT
Topic
Name
9+7 =