0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

NLB経由のDocumentDBへローカルから接続するプログラム

Posted at

NLB経由のAmazon DocumentDBにプログラムから接続する際の備忘録。
元々の参考記事は👇

結果

directConnection=true

const { MongoClient } = require('mongodb');

const client = new MongoClient(
  'mongodb://<userName>:<PassWord>@<NLBのドメイン名>:27017',
  {
    tlsCAFile: '****.pem',
    tls: true,
    tlsAllowInvalidCertificates: true,
    tlsAllowInvalidHostnames: true,
    retryWrites: false,
+   directConnection: true,
  }
);

ヒント

SSH トンネルに MongoDB Compass を使用する場合は、ダイレクト接続をアクティブにしてレプリカ セット接続をオフにします。詳細については、MongoDB Web サイトの「直接接続をオンにする」を参照してください。

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?