Result Size: 625 x 571
demo_mongodb_findone.js:
x
 
var MongoClient = require('mongodb').MongoClient;
var url = "mongodb://localhost:27017/";
MongoClient.connect(url, function(err, db) {
  if (err) throw err;
  var dbo = db.db("mydb");
  //Find the first document in the customers collection:
  dbo.collection("customers").findOne({}, function(err, result) {
    if (err) throw err;
    console.log(result.name);
    db.close();
  });
});
C:\Users\My Name>node demo_mongodb_findone.js
Company Inc.