mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
👕 Fix lint issue
This commit is contained in:
@@ -22,7 +22,7 @@ export class MongoDb implements INodeType {
|
||||
|
||||
const client: MongoClient = await MongoClient.connect(connectionString, {
|
||||
useNewUrlParser: true,
|
||||
useUnifiedTopology: true
|
||||
useUnifiedTopology: true,
|
||||
});
|
||||
|
||||
const mdb = client.db(database as string);
|
||||
@@ -76,8 +76,8 @@ export class MongoDb implements INodeType {
|
||||
returnItems.push({
|
||||
json: {
|
||||
...insertItems[parseInt(i, 10)],
|
||||
id: insertedIds[parseInt(i, 10)] as string
|
||||
}
|
||||
id: insertedIds[parseInt(i, 10)] as string,
|
||||
},
|
||||
});
|
||||
}
|
||||
} else if (operation === 'update') {
|
||||
|
||||
@@ -12,15 +12,15 @@ export const nodeDescription: INodeTypeDescription = {
|
||||
description: 'Find, insert and update documents in MongoDB.',
|
||||
defaults: {
|
||||
name: 'MongoDB',
|
||||
color: '#13AA52'
|
||||
color: '#13AA52',
|
||||
},
|
||||
inputs: ['main'],
|
||||
outputs: ['main'],
|
||||
credentials: [
|
||||
{
|
||||
name: 'mongoDb',
|
||||
required: true
|
||||
}
|
||||
required: true,
|
||||
},
|
||||
],
|
||||
properties: [
|
||||
{
|
||||
@@ -31,26 +31,26 @@ export const nodeDescription: INodeTypeDescription = {
|
||||
{
|
||||
name: 'Delete',
|
||||
value: 'delete',
|
||||
description: 'Delete documents.'
|
||||
description: 'Delete documents.',
|
||||
},
|
||||
{
|
||||
name: 'Find',
|
||||
value: 'find',
|
||||
description: 'Find documents.'
|
||||
description: 'Find documents.',
|
||||
},
|
||||
{
|
||||
name: 'Insert',
|
||||
value: 'insert',
|
||||
description: 'Insert documents.'
|
||||
description: 'Insert documents.',
|
||||
},
|
||||
{
|
||||
name: 'Update',
|
||||
value: 'update',
|
||||
description: 'Updates documents.'
|
||||
}
|
||||
description: 'Updates documents.',
|
||||
},
|
||||
],
|
||||
default: 'find',
|
||||
description: 'The operation to perform.'
|
||||
description: 'The operation to perform.',
|
||||
},
|
||||
|
||||
{
|
||||
@@ -59,7 +59,7 @@ export const nodeDescription: INodeTypeDescription = {
|
||||
type: 'string',
|
||||
required: true,
|
||||
default: '',
|
||||
description: 'MongoDB Collection'
|
||||
description: 'MongoDB Collection',
|
||||
},
|
||||
|
||||
// ----------------------------------
|
||||
@@ -70,19 +70,19 @@ export const nodeDescription: INodeTypeDescription = {
|
||||
name: 'query',
|
||||
type: 'json',
|
||||
typeOptions: {
|
||||
rows: 5
|
||||
rows: 5,
|
||||
},
|
||||
displayOptions: {
|
||||
show: {
|
||||
operation: [
|
||||
'delete'
|
||||
'delete',
|
||||
],
|
||||
},
|
||||
},
|
||||
default: '{}',
|
||||
placeholder: `{ "birth": { "$gt": "1950-01-01" } }`,
|
||||
required: true,
|
||||
description: 'MongoDB Delete query.'
|
||||
description: 'MongoDB Delete query.',
|
||||
},
|
||||
|
||||
// ----------------------------------
|
||||
@@ -93,17 +93,17 @@ export const nodeDescription: INodeTypeDescription = {
|
||||
name: 'query',
|
||||
type: 'json',
|
||||
typeOptions: {
|
||||
rows: 5
|
||||
rows: 5,
|
||||
},
|
||||
displayOptions: {
|
||||
show: {
|
||||
operation: ['find']
|
||||
}
|
||||
operation: ['find'],
|
||||
},
|
||||
},
|
||||
default: '{}',
|
||||
placeholder: `{ "birth": { "$gt": "1950-01-01" } }`,
|
||||
required: true,
|
||||
description: 'MongoDB Find query.'
|
||||
description: 'MongoDB Find query.',
|
||||
},
|
||||
|
||||
// ----------------------------------
|
||||
@@ -115,13 +115,13 @@ export const nodeDescription: INodeTypeDescription = {
|
||||
type: 'string',
|
||||
displayOptions: {
|
||||
show: {
|
||||
operation: ['insert']
|
||||
}
|
||||
operation: ['insert'],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
placeholder: 'name,description',
|
||||
description:
|
||||
'Comma separated list of the fields to be included into the new document.'
|
||||
'Comma separated list of the fields to be included into the new document.',
|
||||
},
|
||||
|
||||
// ----------------------------------
|
||||
@@ -133,13 +133,13 @@ export const nodeDescription: INodeTypeDescription = {
|
||||
type: 'string',
|
||||
displayOptions: {
|
||||
show: {
|
||||
operation: ['update']
|
||||
}
|
||||
operation: ['update'],
|
||||
},
|
||||
},
|
||||
default: 'id',
|
||||
required: true,
|
||||
description:
|
||||
'Name of the property which decides which rows in the database should be updated. Normally that would be "id".'
|
||||
'Name of the property which decides which rows in the database should be updated. Normally that would be "id".',
|
||||
},
|
||||
{
|
||||
displayName: 'Fields',
|
||||
@@ -147,13 +147,13 @@ export const nodeDescription: INodeTypeDescription = {
|
||||
type: 'string',
|
||||
displayOptions: {
|
||||
show: {
|
||||
operation: ['update']
|
||||
}
|
||||
operation: ['update'],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
placeholder: 'name,description',
|
||||
description:
|
||||
'Comma separated list of the fields to be included into the new document.'
|
||||
}
|
||||
]
|
||||
'Comma separated list of the fields to be included into the new document.',
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
@@ -44,7 +44,7 @@ function buildMongoConnectionParams(
|
||||
) {
|
||||
return {
|
||||
connectionString: credentials.connectionString.trim(),
|
||||
database: sanitizedDbName
|
||||
database: sanitizedDbName,
|
||||
};
|
||||
} else {
|
||||
throw new Error(
|
||||
@@ -54,7 +54,7 @@ function buildMongoConnectionParams(
|
||||
} else {
|
||||
return {
|
||||
connectionString: buildParameterizedConnString(credentials),
|
||||
database: sanitizedDbName
|
||||
database: sanitizedDbName,
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -71,7 +71,7 @@ export function validateAndResolveMongoCredentials(
|
||||
throw new Error('No credentials got returned!');
|
||||
} else {
|
||||
return buildMongoConnectionParams(
|
||||
credentials as unknown as IMongoCredentialsType,
|
||||
credentials as unknown as IMongoCredentialsType
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user