Nodejs mongoDb driver code to access and create database
var mongo = require("mongodb");
var db = new mongo.Db("myapp", new mongo.Server("localhost", 27017));
var people = db.collection("people");
and to query
people.find()
Is there any way i can access mongoDb console in nodeJs mongoDb driver so i can test my queries there
Any command you run in the console can be run through the driver using the .command function on the Db object. However I suggest you use the console of for management as it's a bit easier than duplicating the effort using the driver.
You're probably looking for mongo-sync or Mongolian DeadBeef which are advertised as nodejs drivers which more closely pattern the mongo command line interface. I would use them with caution though, since they are not core mongo supported drivers.