function isAllStudentsExistInDB(registerNumbers = []) {

    return Student.find({ registerNumber: { $in: registerNumbers } }, { id: true, registerNumber: true, _id: false }).exec()
        .then(students => {
            const isAllStudentsExist = (students.length > 0) && (students.length === registerNumbers.length);
            if (isAllStudentsExist) {
                return students;
            } else {
                throw new Error(errors.results.FileUpload.unknownRegisterNumbers);
            }
        })
}
// present in uploaded data are present in database or not
present in uploaded data are present in database or not
present in uploaded data are present in database or not
function isAllStudentsExistInDB(registerNumbers = []) {
    return Student.find({ registerNumber: { $in: registerNumbers } }, { id: true, registerNumber: true, _id: false }).exec()
        .then(students => {
            const isAllStudentsExist = (students.length > 0) && (students.length === registerNumbers.length);
            if (isAllStudentsExist) {
                return students;
            } else {
                throw new Error(errors.results.FileUpload.unknownRegisterNumbers);
            }
        })
}
function isAllStudentsExistInDB ( registerNumbers = [ ] ) { return Student . find ( { registerNumber : { $in : registerNumbers } } , { id : true , registerNumber : true , _id : false } ) . exec ( ) . then ( students => { const isAllStudentsExist = ( students . length > 0 ) && ( students . length === registerNumbers . length ) ; if ( isAllStudentsExist ) { return students ; } else { throw new Error ( errors . results . FileUpload . unknownRegisterNumbers ) ; } } ) }
present in uploaded data are present in database or not
present in uploaded data are present in database or not