Skip to content

Commit

Permalink
Remove the async/await on/in aggregateMessagesContainingKeyword
Browse files Browse the repository at this point in the history
  • Loading branch information
nmagedman committed Jan 20, 2025
1 parent 1842ac6 commit 2e0f532
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ async function perform() {
}
}

async function aggregateMessagesContainingKeyword(keyword, date) {
function aggregateMessagesContainingKeyword(keyword, date) {
const matchDoc = buildMongoMatchDoc(keyword, date);
const pipeline = buildMongoPipelineArray(matchDoc);

return await Messages.col.aggregate(
return Messages.col.aggregate(
pipeline,
{ readPreference: readSecondaryPreferred() }
).toArray();
Expand Down

0 comments on commit 2e0f532

Please sign in to comment.