Connecting to mongodb

Code:

     var Db = require('mongodb').Db,
        Server = require('mongodb').Server,
        Client = new Db('test', new Server('127.0.0.1', 52235, {}))

In Function: ...

     Client.open(function(err, pClient) {
        Client.collection('test_insert', function(err, collection){
            collection.find().toArray(function(err, results) {
                console.log(results);
            });
        });
        // etc.
     });

This shows error: Cannot read property 'arbiterOnly' of undefined can you help me?

This error occurs because it couldn't connect to the server and so the configuration information wasn't properly received. Probably you are using the wrong port: try 27017.