Fix bot logon, should do nested match.

Add comment to migrations.
Fix attachment deletes on messages.
This commit is contained in:
Paul
2021-09-11 17:46:20 +01:00
parent fa8eb874d0
commit 8bb5fb25dd
3 changed files with 8 additions and 14 deletions

View File

@@ -467,7 +467,7 @@ impl Message {
let attachment_ids: Vec<String> =
attachments.iter().map(|f| f.id.to_string()).collect();
get_collection("attachments")
.update_one(
.update_many(
doc! {
"_id": {
"$in": attachment_ids
@@ -482,7 +482,7 @@ impl Message {
)
.await
.map_err(|_| Error::DatabaseError {
operation: "update_one",
operation: "update_many",
with: "attachment",
})?;
}