Now using the MongoDB $in query operator to bulk delete messages. The code is cleaner and more efficient.