feat(MongoDb Node): Add Aggregate Operation

* MongoDB Aggregate Option

*  small improvements to UI

Co-authored-by: Michael Kret <michael.k@radency.com>
This commit is contained in:
Luiz Eduardo de Oliveira Fonseca
2022-03-12 16:01:44 -03:00
committed by GitHub
parent 195f104ef5
commit 2c9a06e863
2 changed files with 62 additions and 5 deletions

View File

@@ -29,6 +29,11 @@ export const nodeDescription: INodeTypeDescription = {
name: 'operation',
type: 'options',
options: [
{
name: 'Aggregate',
value: 'aggregate',
description: 'Aggregate documents.',
},
{
name: 'Delete',
value: 'delete',
@@ -63,6 +68,30 @@ export const nodeDescription: INodeTypeDescription = {
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
// ----------------------------------
@@ -149,6 +178,7 @@ export const nodeDescription: INodeTypeDescription = {
required: true,
description: 'MongoDB Find query.',
},
// ----------------------------------
// insert
// ----------------------------------