1
0
Fork 0
mirror of synced 2024-06-14 08:24:48 +12:00

MongoDb Delete fix

This commit is contained in:
Mel O'Hagan 2022-05-13 14:53:04 +01:00 committed by mike12345567
parent 4b7f1391f8
commit 094a548e38

View file

@ -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(