Object#
Object.compact()#
Description: 移除所有值为空的字段,即值为 null 或 "" 的字段
Syntax: Object.compact()
Returns: Object
Source: Custom n8n functionality
Examples:
1 2 | |
Object.hasField()#
Description: 如果存在名为 name 的字段,则返回 true。仅检查顶层键。比较区分大小写。
Syntax: Object.hasField(name)
Returns: Boolean
Source: Custom n8n functionality
Parameters:
name(String) - 要搜索的键名
Examples:
1 2 | |
1 2 3 | |
Object.isEmpty()#
Description: 如果 Object 没有设置任何键(字段)或为 null,则返回 true
Syntax: Object.isEmpty()
Returns: Boolean
Source: Custom n8n functionality
Examples:
1 2 | |
1 2 | |
Object.isNotEmpty()#
Description: 如果 Object 至少设置了一个键(字段),则返回 true
Syntax: Object.isNotEmpty()
Returns: Boolean
Source: Custom n8n functionality
Examples:
1 2 | |
1 2 | |
Object.keepFieldsContaining()#
Description: 移除值未至少部分匹配给定 value 的所有字段。比较区分大小写。非字符串类型的字段将始终被移除。
Syntax: Object.keepFieldsContaining(value)
Returns: Object
Source: Custom n8n functionality
Parameters:
value(String) - 值必须包含的文本才能被保留
Examples:
1 2 | |
1 2 3 | |
Object.keys()#
Description: 返回包含 Object 所有字段名(键)的数组。与 JavaScript 的 Object.keys(obj) 相同。
Syntax: Object.keys()
Returns: Array
Source: Custom n8n functionality
Examples:
1 2 | |
Object.merge()#
Description: 将两个 Object 合并为一个。如果某个键(字段名)同时存在于两个 Object 中,则使用第一个(基础)Object 的值。
Syntax: Object.merge(otherObject)
Returns: Object
Source: Custom n8n functionality
Parameters:
otherObject(Object) - 要与基础 Object 合并的对象。
Examples:
1 2 3 | |
Object.removeField()#
Description: 从 Object 中移除一个字段。与 JavaScript 的 delete 相同。
Syntax: Object.removeField(key)
Returns: Object
Source: Custom n8n functionality
Parameters:
key(String) - 要移除的字段名
Examples:
1 2 | |
Object.removeFieldsContaining()#
Description: 移除值至少部分匹配给定 value 的键(字段)。比较区分大小写。非字符串类型的字段始终被保留。
Syntax: Object.removeFieldsContaining(value)
Returns: Object
Source: Custom n8n functionality
Parameters:
value(String) - 值必须包含的文本才会被移除
Examples:
1 2 | |
1 2 3 | |
Object.toJsonString()#
Description: 将 Object 转换为 JSON 字符串。类似于 JavaScript 的 JSON.stringify()。
Syntax: Object.toJsonString()
Returns: String
Source: Custom n8n functionality
Examples:
1 2 | |
Object.urlEncode()#
Description: 从 Object 的键和值生成 URL 参数字符串。仅支持顶层键。
Syntax: Object.urlEncode()
Returns: String
Source: Custom n8n functionality
Examples:
1 2 | |
Object.values()#
Description: 返回包含 Object 所有字段值的数组。与 JavaScript 的 Object.values(obj) 相同。
Syntax: Object.values()
Returns: Array
Source: Custom n8n functionality
Examples:
1 2 | |