Express How to get all data from mongodb
<p>Im new to MEAN Stack and When I query mongo following response is obtained</p>

<pre><code>db.dashboard.find()

[{
    "_id" : ObjectId("57384b402affdfa8aaef44d7"),
    "file" : "/fire.wma",
    "result" : "Ap",
    "sentenceId" : 40,
    "synced" : 1,
    "iscorrect" : "no",
    "user_id" : ObjectId("57384a577c5176914524bd5c")
}, {    
    "_id" : ObjectId("57384e3fbb5e9f33f7f0150e"),
    "file" : "/check.wma",  
    "result" : "AM",    
    "sentenceId" : 90,  
    "synced" : 0,
    "iscorrect" : "yes",
    "user_id" : ObjectId("57384a577c5176914524bd5c") 
}]
</code></pre>

<p>There are 2 objects present in dashboard collection</p>

<p>Im trying to do the same in express but Im not able to get the desired result</p>

<pre><code> function getById(_id) {
    var deferred = Q.defer();
    var dashboard = db.collection('dashboard');

    db.collection('dashboard').find({user_id : ObjectId(_id)}, function (err, user) {
        console.log(user)
        console.log(_id)

        if (err) deferred.reject(err);

        if (user) {
            // return user (without hashed password)
            deferred.resolve(_.omit(user, 'hash'));
        } else {
            // user not found
            deferred.resolve();
        }
    });

    return deferred.promise;
}
</code></pre>

<p>Im not getting values from Mongodb, Instead Im getting values like</p>

<pre><code>Readable {
  pool: null,
  server: null,
  disconnectHandler:
   { s: { storedOps: [], storeOptions: [Object], topology: [Object] },
     length: [Getter] },
  .........
  .........
</code></pre>

<p>Any help on getting all values from mongodb is truly appreciated. </p>

<p>Expected output should be as the one which is queried from mongodb  </p>