I am new to mongoDB and mongoose, i have this simple document in 'users' collection in MongoLab:
{
"_id": {
"$oid": "55819f00e4b0a09388237163"
},
"name": "john"
}
In my express:
var mongoose = require('mongoose');
mongoose.connect('mongodb://ds047***.mongolab.com:47792/heroku_16lpd***');
mongoose.model('users', {name: String});
mongoose.model('users').find(function(err, users){
console.log(users); => undefind
});
and getting undefined. could it be that my connection string is wrong?