0215 백엔드반복문

팡태(❁´◡`❁)·2022년 2월 15일
0

3rd_20220124

목록 보기
28/29
    // result => [{ _id: 1 }, { _id: 2 }]
    // $in = [] => [1, 2, 3, 4]

    // result1.5 -> [{ _id: 1 }, { _id: 2 }] 이렇게 변경시켜야 한다
    let code = [];
    for(let tmp of result) {
        code.push(tmp._id);
    }

    // for(let i=0; i<result.length; i++) {
    //     code.push(result[i]_.id)
    // }

0개의 댓글