mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
⚡ Add "Date Fields" parameter to the insert & update operations
MongoDB
This commit is contained in:
@@ -102,3 +102,14 @@ export function getItemCopy(
|
||||
return newItem;
|
||||
});
|
||||
}
|
||||
|
||||
export function handleDateFields(insertItems: IDataObject[], fields: string) {
|
||||
const dateFields = (fields as string).split(',');
|
||||
for (let i = 0; i < insertItems.length; i++) {
|
||||
for (const key of Object.keys(insertItems[i])) {
|
||||
if (dateFields.includes(key)) {
|
||||
insertItems[i][key] = new Date(insertItems[i][key] as string);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user