diff --git a/lib/tasks/audit.js b/lib/tasks/audit.js index 58aa071d..7a18f789 100644 --- a/lib/tasks/audit.js +++ b/lib/tasks/audit.js @@ -30,10 +30,12 @@ let run = async (taskData, options) => { } let mailboxes = new Map( - (await db.database - .collection('mailboxes') - .find({ user: taskData.user }) - .toArray()).map(mailboxData => [mailboxData._id.toString(), mailboxData]) + ( + await db.database + .collection('mailboxes') + .find({ user: taskData.user }) + .toArray() + ).map(mailboxData => [mailboxData._id.toString(), mailboxData]) ); let processMessage = async messageData => { @@ -61,7 +63,7 @@ let run = async (taskData, options) => { let status = 'imported'; //expect to complete successfully let processMessages = async collection => { - let cursor = await db.users.collection(collection).find(query, { + let cursor = await db.database.collection(collection).find(query, { projection: { _id: true, user: true,