fixed invalid db for audits

This commit is contained in:
Andris Reinman 2019-11-21 11:37:00 +02:00
parent 7059f00e46
commit 2681ceb764
No known key found for this signature in database
GPG key ID: 5388A30A31834D83

View file

@ -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,