How to get the values from array using node.js?
<p>The array result shows like following</p>

<pre><code>[ 
    { 
        _id: 56fe444d6ce2226431f5388c,
        name: 'admin',
        email: 'admin@gmail.com',
        password: '$2a$10$Wz34L5QZ6ACQIP.Q2WOJLuOSvs0aHQbSO1bhhOpiiXDOaN/AIF8U2',
        occasiontype: 'Anniversary',
        date: Mon Apr 18 2016 00:00:00 GMT+0530 (India Standard Time),
        __v: 0 
    }
]
</code></pre>

<h2>node.js</h2>

<pre><code>router.post('/find-registry', function(req, res){
        var uEmail = req.body.email;

        var findUserId = function(db, callback) {
            var cursor =db.collection('users').find({email:uEmail}).toArray(function(err, docs){
                if(err){  
                    callback(new Error("Some problem"));
                } else {
                    callback(null,docs);
                } 
            });
        };

        MongoClient.connect(url, function(err, db) {
            assert.equal(null, err);
            findUserId(db, function(err,docs) {
                db.close();
                console.log(docs);
            });
        }); 


    });
</code></pre>

<p>Here the <code>console.log(docs)</code> showing the result of array. But there i need only <strong>name</strong>. How do i get it? I tried like <code>console.log(docs[name])</code> but it showing undefined.</p>