mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
feat(MongoDB Node): Add support for TLS (#8266)
This commit is contained in:
@@ -17,12 +17,13 @@ import type {
|
||||
UpdateOptions,
|
||||
Sort,
|
||||
} from 'mongodb';
|
||||
import { MongoClient, ObjectId } from 'mongodb';
|
||||
import { ObjectId } from 'mongodb';
|
||||
import { generatePairedItemData } from '../../utils/utilities';
|
||||
import { nodeProperties } from './MongoDbProperties';
|
||||
|
||||
import {
|
||||
buildParameterizedConnString,
|
||||
connectMongoClient,
|
||||
prepareFields,
|
||||
prepareItems,
|
||||
stringifyObjectIDs,
|
||||
@@ -74,7 +75,7 @@ export class MongoDb implements INodeType {
|
||||
);
|
||||
}
|
||||
|
||||
const client: MongoClient = await MongoClient.connect(connectionString);
|
||||
const client = await connectMongoClient(connectionString, credentials);
|
||||
|
||||
const { databases } = await client.db().admin().listDatabases();
|
||||
|
||||
@@ -100,12 +101,10 @@ export class MongoDb implements INodeType {
|
||||
};
|
||||
|
||||
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
|
||||
const { database, connectionString } = validateAndResolveMongoCredentials(
|
||||
this,
|
||||
await this.getCredentials('mongoDb'),
|
||||
);
|
||||
const credentials = await this.getCredentials('mongoDb');
|
||||
const { database, connectionString } = validateAndResolveMongoCredentials(this, credentials);
|
||||
|
||||
const client: MongoClient = await MongoClient.connect(connectionString);
|
||||
const client = await connectMongoClient(connectionString, credentials);
|
||||
|
||||
const mdb = client.db(database);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user