mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
✨ Add limit, skip, sort, upsert in MongoDB node (#1439)
* mongodb find command improvements: limit, skip, sort * mongodb update command improvement: upsert * ⚡ improve mongo node * 🎨 add missing semicolons Co-authored-by: ahsan-virani <ahsan.virani@gmail.com>
This commit is contained in:
@@ -90,6 +90,47 @@ export const nodeDescription: INodeTypeDescription = {
|
||||
// ----------------------------------
|
||||
// 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',
|
||||
@@ -109,7 +150,6 @@ export const nodeDescription: INodeTypeDescription = {
|
||||
required: true,
|
||||
description: 'MongoDB Find query.',
|
||||
},
|
||||
|
||||
// ----------------------------------
|
||||
// insert
|
||||
// ----------------------------------
|
||||
@@ -165,6 +205,18 @@ export const nodeDescription: INodeTypeDescription = {
|
||||
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',
|
||||
|
||||
Reference in New Issue
Block a user