InfoGrab Docs

이전 노드가 반환한 항목 수 가져오기

Code 노드에서 이전 노드가 반환한 항목의 수를 JavaScript 또는 Python으로 가져오는 방법을 설명합니다.

이전 노드가 반환한 항목 수를 가져오려면: JavaScript Python if ( Object . keys (items[ 0 ]. json ). length === 0 ) { return [ { json : { results : 0 , } } ] } return [ { json : { results : items. length , } } ]; 출력은 다음과 유사합니다. [ { "results" : 8 } ] if len (items[ 0 ].json) == 0 : return [ { "json" : { "results" : 0 , } } ] else : return [ { "json" : { "results" : items.length, } } ] 출력은 다음과 유사합니다. [ { "results" : 8 } ]