var MongoClient = require('mongodb').MongoClient,
f = require('util').format,
fs = require('fs');
//Specify the Amazon DocumentDB certvar ca = [fs.readFileSync("/somewhere/over/the/rainbow/rds-combined-ca-bundle.pem")];
//Create a MongoDB client, open a connection to Amazon DocumentDB as a replica set, // and specify the read preference as secondary preferredvar client = MongoClient.connect(
'mongodb://<sample-user>:<password>@localhost:27017/?ssl=true',
{
useUnifiedTopology: true,
sslValidate: false,
sslCA:ca,
useNewUrlParser: true},
function(err, client) {if(err)
throw err;
//Specify the database to be used
db = client.db('sample-database');
//Specify the collection to be used
col = db.collection('sample-collection');
//Insert a single document
col.insertOne({'hello':'Amazon DocumentDB'}, function(err, result){//Find the document that was previously written
col.findOne({'hello':'Amazon DocumentDB'}, function(err, result){//Print the result to the screen
console.log(result);
//Close the connection
client.close()
});
});
});
テナーバンジョー奏者の CD を聴いてたら楽器も欲しくなってしまい、アマゾンをウロウロしてて偶然みつけたものです。要はテナーウクレレサイズなギター(所謂ギタレレ)のバンジョー版なのですが、これはありそうでなかなか見た事が無かったので「珍楽器は一期一会」の掟に従ってポチりました。お値段もリーズナブルですしね。