From 094a548e383d23478e275864a2b1491d75b7d7f2 Mon Sep 17 00:00:00 2001 From: Mel O'Hagan Date: Fri, 13 May 2022 14:53:04 +0100 Subject: [PATCH] MongoDb Delete fix --- packages/server/src/integrations/mongodb.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/server/src/integrations/mongodb.ts b/packages/server/src/integrations/mongodb.ts index ae6bd3b0dc..2cdc5c5ebc 100644 --- a/packages/server/src/integrations/mongodb.ts +++ b/packages/server/src/integrations/mongodb.ts @@ -222,13 +222,14 @@ module MongoDBModule { await this.connect() const db = this.client.db(this.config.db) const collection = db.collection(query.extra.collection) + let json = this.createObjectIds(query.json) switch (query.extra.actionTypes) { case "deleteOne": { - return await collection.deleteOne(query.json) + return await collection.deleteOne(json) } case "deleteMany": { - return await collection.deleteMany(query.json).toArray() + return await collection.deleteMany(json) } default: { throw new Error(