There is an operation to delete history from the collection in MongoDB. But in the server's response there is no need to send data about how the deletion ended, even if it takes half an hour, the answer must be given immediately. Ie without await . But such a record does not work at all:
History.remove({account: {$in: accountIds}}); And this is not clear toli waiting toli seems to me:
History.remove({account: {$in: accountIds}}).exec(); Tell me how to implement this behavior so as not to wait, considering that the function itself in which all this happens is marked as async .