이것은 official MongoDB documentation입니다.cursor.toArray (err, docs) {})에서 err 및 doc의 의미는 무엇입니까?
toArray cursor.toArray(function(err, docs){})
은 커서 개체를 일치하는 모든 레코드의 배열로 변환합니다. 아마도 결과를 가져 오는 가장 편리한 방법이지만 모든 레코드가 메모리에로드 될 때 큰 데이터 세트에주의해야합니다.
collection.find().toArray(function(err, docs){
console.log("retrieved records:");
console.log(docs);
});
cursor.toArray (function (err, docs) {})에서 err과 doc의 의미는 무엇입니까?
오류 - 커서에서 읽는 동안 오류가 발생했습니다. 오류가 없으면 null입니다. Docs - 커서에서 읽은 문서의 배열. –
'toArray'에 대한 더 나은 문서는 다음에서 찾을 수 있습니다. http://mongodb.github.io/node-mongodb-native/api-generated/cursor.html#toarray – JohnnyHK