The objective is to check for duplicate records in a MongoDB and return a new file object (filteredObj) that does not contain records already existed in the DB. Each record has a description key.
hasDuplicateDescription method returns a Promise that resolves to a true or false, true if there is no existing record.description in the DB, false otherwise. However, the returned filteredObj has the original fileObj content, without any filtering done.
The solution below was the recommended solution for getting async function to work with array.filter in other posts but it does not work in this case as hasDuplicateDescription is an async function that requires each array element passed in by the array.filter method as its argument.