Skip to content

Commit

Permalink
fix: connection object
Browse files Browse the repository at this point in the history
  • Loading branch information
euberdeveloper committed Jan 9, 2020
1 parent d50ac22 commit b64704c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* The function type of that can be used as value of the "fileName" option.
* The function type that can be used as value of the "fileName" option.
* @param db The database of the collection that will be exported
* @param collection The the collection that will be exported
* @param type The type of the collection that will be exported
Expand Down
26 changes: 12 additions & 14 deletions source/lib/utils/connection/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,18 @@ import { ConnectionParameters } from '../../interfaces/connection';
async function getMongoConnectionOptions(options: ConnectionOptions): Promise<MongoClientOptions> {
const result: MongoClientOptions = {};

result.replicaSet = options.replicaSetName;
result.authSource = options.authenticationDatabase;
result.authMechanism = options.authenticationMechanism;
result.ssl = options.ssl;
/* (result as any).replicaSet = options.replicaSetName;
(result as any).authSource = options.authenticationDatabase;
(result as any).authMechanism = options.authenticationMechanism;
(result as any).tls = options.ssl;
(result as any).tlsCAFile = options.sslCAFile;
(result as any).tlsCertificateKeyFile = options.sslPEMKeyFile;
(result as any).tlsCertificateKeyFilePassword = options.sslPEMKeyPassword;
(result as any).tlsAllowInvalidCertificates = options.sslAllowInvalidCertificates;
(result as any).tlsAllowInvalidHostnames = options.sslAllowInvalidHostnames;
(result as any).gssapiServiceName = options.gssapiServiceName; */
if (options.replicaSetName) {
result.replicaSet = options.replicaSetName;
}
if (options.authenticationDatabase) {
result.authSource = options.authenticationDatabase;
}
if (options.authenticationMechanism) {
result.authMechanism = options.authenticationMechanism;
}
if (options.ssl) {
result.ssl = options.ssl;
}

return result;
}
Expand Down

0 comments on commit b64704c

Please sign in to comment.