獲取您自己的 Node 伺服器
var MongoClient = require('mongodb').MongoClient;
var url = "mongodb://:27017/mydb";

MongoClient.connect(url, function(err, db) {
  if (err) throw err;
  //Exclude the _id field from the result:
  db.collection("customers").find({}, { projection: { _id: 0 } }).toArray(function(err, result) {
    if (err) throw err;
    console.log(result);
    db.close();
  });
});

              
[
{ 姓名: 'John', 地址: 'Highway 71'},
{ 姓名: 'Peter', 地址: 'Lowstreet 4'},
{ 姓名: 'Amy', 地址: 'Apple st 652'},
{ 姓名: 'Hannah', 地址: 'Mountain 21'},
{ 姓名: 'Michael', 地址: 'Valley 345'},
{ 姓名: 'Sandy', 地址: 'Ocean blvd 2'},
{ 姓名: 'Betty', 地址: 'Green Grass 1'},
{ 姓名: 'Richard', 地址: 'Sky st 331'},
{ 姓名: 'Susan', 地址: 'One way 98'},
{ 姓名: 'Vicky', 地址: 'Yellow Garden 2'},
{ 姓名: 'Ben', 地址: 'Park Lane 38'},
{ 姓名: 'William', 地址: 'Central st 954'},
{ 姓名: 'Chuck', 地址: 'Main Road 989'},
{ 姓名: 'Viola', 地址: 'Sideway 1633'}
]