跳到主要内容

获取上一个节点返回的项目数量#

要获取上一个节点返回的项目数量:

JavaScriptPython
if (Object.keys(items[0].json).length === 0) { return [ { json: { results: 0, } } ] } return [ { json: { results: items.length, } } ];if len(items[0].json) == 0: return [ { "json": { "results": 0, } } ] else: return [ { "json": { "results": items.length, } } ]

输出将类似于以下内容。

 [ 	{ 		"results": 8 	} ]