mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-10 22:54:05 -08:00
0448feec56
* ⚡ Initial setup
* 👕 Update `.eslintignore`
* 👕 Autofix node-param-default-missing (#3173)
* 🔥 Remove duplicate key
* 👕 Add exceptions
* 📦 Update package-lock.json
* 👕 Apply `node-class-description-inputs-wrong-trigger-node` (#3176)
* 👕 Apply `node-class-description-inputs-wrong-regular-node` (#3177)
* 👕 Apply `node-class-description-outputs-wrong` (#3178)
* 👕 Apply `node-execute-block-double-assertion-for-items` (#3179)
* 👕 Apply `node-param-default-wrong-for-collection` (#3180)
* 👕 Apply node-param-default-wrong-for-boolean (#3181)
* Autofixed default missing
* Autofixed booleans, worked well
* ⚡ Fix params
* ⏪ Undo exempted autofixes
* 📦 Update package-lock.json
* 👕 Apply node-class-description-missing-subtitle (#3182)
* ⚡ Fix missing comma
* 👕 Apply `node-param-default-wrong-for-fixed-collection` (#3184)
* 👕 Add exception for `node-class-description-missing-subtitle`
* 👕 Apply `node-param-default-wrong-for-multi-options` (#3185)
* 👕 Apply `node-param-collection-type-unsorted-items` (#3186)
* Missing coma
* 👕 Apply `node-param-default-wrong-for-simplify` (#3187)
* 👕 Apply `node-param-description-comma-separated-hyphen` (#3190)
* 👕 Apply `node-param-description-empty-string` (#3189)
* 👕 Apply `node-param-description-excess-inner-whitespace` (#3191)
* Rule looks good
* Add whitespace rule in eslint config
* :zao: fix
* 👕 Apply `node-param-description-identical-to-display-name` (#3193)
* 👕 Apply `node-param-description-missing-for-ignore-ssl-issues` (#3195)
* ⏪ Revert ":zao: fix"
This reverts commit ef8a76f3df
.
* 👕 Apply `node-param-description-missing-for-simplify` (#3196)
* 👕 Apply `node-param-description-missing-final-period` (#3194)
* Rule working as intended
* Add rule to eslint
* 👕 Apply node-param-description-missing-for-return-all (#3197)
* ⚡ Restore `lintfix` command
Co-authored-by: agobrech <45268029+agobrech@users.noreply.github.com>
Co-authored-by: Omar Ajoue <krynble@gmail.com>
Co-authored-by: agobrech <ael.gobrecht@gmail.com>
Co-authored-by: Michael Kret <michael.k@radency.com>
280 lines
5.6 KiB
TypeScript
280 lines
5.6 KiB
TypeScript
import {
|
|
INodeTypeDescription,
|
|
} from 'n8n-workflow';
|
|
|
|
/**
|
|
* Options to be displayed
|
|
*/
|
|
export const nodeDescription: INodeTypeDescription = {
|
|
displayName: 'MongoDB',
|
|
name: 'mongoDb',
|
|
icon: 'file:mongodb.svg',
|
|
group: ['input'],
|
|
version: 1,
|
|
description: 'Find, insert and update documents in MongoDB',
|
|
defaults: {
|
|
name: 'MongoDB',
|
|
},
|
|
inputs: ['main'],
|
|
outputs: ['main'],
|
|
credentials: [
|
|
{
|
|
name: 'mongoDb',
|
|
required: true,
|
|
},
|
|
],
|
|
properties: [
|
|
{
|
|
displayName: 'Operation',
|
|
name: 'operation',
|
|
type: 'options',
|
|
options: [
|
|
{
|
|
name: 'Aggregate',
|
|
value: 'aggregate',
|
|
description: 'Aggregate documents.',
|
|
},
|
|
{
|
|
name: 'Delete',
|
|
value: 'delete',
|
|
description: 'Delete documents.',
|
|
},
|
|
{
|
|
name: 'Find',
|
|
value: 'find',
|
|
description: 'Find documents.',
|
|
},
|
|
{
|
|
name: 'Insert',
|
|
value: 'insert',
|
|
description: 'Insert documents.',
|
|
},
|
|
{
|
|
name: 'Update',
|
|
value: 'update',
|
|
description: 'Update documents.',
|
|
},
|
|
],
|
|
default: 'find',
|
|
description: 'The operation to perform.',
|
|
},
|
|
|
|
{
|
|
displayName: 'Collection',
|
|
name: 'collection',
|
|
type: 'string',
|
|
required: true,
|
|
default: '',
|
|
description: 'MongoDB Collection',
|
|
},
|
|
|
|
// ----------------------------------
|
|
// aggregate
|
|
// ----------------------------------
|
|
{
|
|
displayName: 'Query',
|
|
name: 'query',
|
|
type: 'json',
|
|
typeOptions: {
|
|
alwaysOpenEditWindow: true,
|
|
},
|
|
displayOptions: {
|
|
show: {
|
|
operation: [
|
|
'aggregate',
|
|
],
|
|
},
|
|
},
|
|
default: '',
|
|
placeholder: `[{ "$match": { "$gt": "1950-01-01" }, ... }]`,
|
|
hint: 'Learn more about aggregation pipeline <a href="https://docs.mongodb.com/manual/core/aggregation-pipeline/">here</a>',
|
|
required: true,
|
|
description: 'MongoDB aggregation pipeline query in JSON format',
|
|
},
|
|
|
|
// ----------------------------------
|
|
// delete
|
|
// ----------------------------------
|
|
{
|
|
displayName: 'Delete Query (JSON format)',
|
|
name: 'query',
|
|
type: 'json',
|
|
typeOptions: {
|
|
rows: 5,
|
|
},
|
|
displayOptions: {
|
|
show: {
|
|
operation: [
|
|
'delete',
|
|
],
|
|
},
|
|
},
|
|
default: '{}',
|
|
placeholder: `{ "birth": { "$gt": "1950-01-01" } }`,
|
|
required: true,
|
|
description: 'MongoDB Delete query.',
|
|
},
|
|
|
|
// ----------------------------------
|
|
// find
|
|
// ----------------------------------
|
|
{
|
|
displayName: 'Options',
|
|
name: 'options',
|
|
type: 'collection',
|
|
displayOptions: {
|
|
show: {
|
|
operation: ['find'],
|
|
},
|
|
},
|
|
default: {},
|
|
placeholder: 'Add options',
|
|
description: 'Add query options',
|
|
options: [
|
|
{
|
|
displayName: 'Limit',
|
|
name: 'limit',
|
|
type: 'number',
|
|
default: 0,
|
|
description: 'Use limit to specify the maximum number of documents or 0 for unlimited documents.',
|
|
},
|
|
{
|
|
displayName: 'Skip',
|
|
name: 'skip',
|
|
type: 'number',
|
|
default: 0,
|
|
description: 'The number of documents to skip in the results set.',
|
|
},
|
|
{
|
|
displayName: 'Sort (JSON format)',
|
|
name: 'sort',
|
|
type: 'json',
|
|
typeOptions: {
|
|
rows: 2,
|
|
},
|
|
default: '{}',
|
|
placeholder: '{ "field": -1 }',
|
|
required: true,
|
|
description: 'A json that defines the sort order of the result set.',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
displayName: 'Query (JSON format)',
|
|
name: 'query',
|
|
type: 'json',
|
|
typeOptions: {
|
|
rows: 5,
|
|
},
|
|
displayOptions: {
|
|
show: {
|
|
operation: [
|
|
'find',
|
|
],
|
|
},
|
|
},
|
|
default: '{}',
|
|
placeholder: `{ "birth": { "$gt": "1950-01-01" } }`,
|
|
required: true,
|
|
description: 'MongoDB Find query.',
|
|
},
|
|
|
|
// ----------------------------------
|
|
// insert
|
|
// ----------------------------------
|
|
{
|
|
displayName: 'Fields',
|
|
name: 'fields',
|
|
type: 'string',
|
|
displayOptions: {
|
|
show: {
|
|
operation: [
|
|
'insert',
|
|
],
|
|
},
|
|
},
|
|
default: '',
|
|
placeholder: 'name,description',
|
|
description: `Comma-separated list of the fields to be included into the new document.`,
|
|
},
|
|
|
|
// ----------------------------------
|
|
// update
|
|
// ----------------------------------
|
|
{
|
|
displayName: 'Update Key',
|
|
name: 'updateKey',
|
|
type: 'string',
|
|
displayOptions: {
|
|
show: {
|
|
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".',
|
|
},
|
|
{
|
|
displayName: 'Fields',
|
|
name: 'fields',
|
|
type: 'string',
|
|
displayOptions: {
|
|
show: {
|
|
operation: [
|
|
'update',
|
|
],
|
|
},
|
|
},
|
|
default: '',
|
|
placeholder: 'name,description',
|
|
description: `Comma-separated list of the fields to be included into the new document.`,
|
|
},
|
|
{
|
|
displayName: 'Upsert',
|
|
name: 'upsert',
|
|
type: 'boolean',
|
|
displayOptions: {
|
|
show: {
|
|
operation: ['update'],
|
|
},
|
|
},
|
|
default: false,
|
|
description: `Perform an insert if no documents match the update key`,
|
|
},
|
|
{
|
|
displayName: 'Options',
|
|
name: 'options',
|
|
type: 'collection',
|
|
displayOptions: {
|
|
show: {
|
|
operation: [
|
|
'update',
|
|
'insert',
|
|
],
|
|
},
|
|
},
|
|
placeholder: 'Add Option',
|
|
default: {},
|
|
options: [
|
|
{
|
|
displayName: 'Date Fields',
|
|
name: 'dateFields',
|
|
type: 'string',
|
|
default: '',
|
|
description: 'Comma separeted list of fields that will be parse as Mongo Date type',
|
|
},
|
|
{
|
|
displayName:'Use Dot Notation',
|
|
name: 'useDotNotation',
|
|
type: 'boolean',
|
|
default: false,
|
|
description: 'Wheather to use dot notation to access date fields',
|
|
},
|
|
],
|
|
},
|
|
],
|
|
};
|