イムを使用してクラスタをモンゴに接続するために、私はこの方法最良の方法は、クラスタをMongoのために私のノードアプリを接続しようとマングース
var options = {
useMongoClient: true,
autoIndex: false,
reconnectTries: Number.MAX_VALUE,
reconnectInterval: 500,
poolSize: 10,
bufferMaxEntries: 0
};
var cluster = "my cluster url XXX";
mongoose.connect(cluster, options);
を使用しているが、それは
(node:8701) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): MongoError: topology was destroyed (node:8701) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that a re not handled will terminate the Node.js process with a non-zero exit code.
は、私が知っているこのエラーを投げますこれはクラスタに接続する正しい方法ではありません。 誰にでも最高の方法とその理由を教えてください。(例で) ありがとう!!
の可能性のある重複:のhttps://stackoverflow.com/questions/30909492/mongoerror-topology-was-destroyed – kentor
可能性のある重複した[mongoError:トポロジが破壊された(HTTPS:/ /stackoverflow.com/questions/30909492/mongoerror-topology-was-destroyed) – kentor