MongoDb Delete fix
This commit is contained in:
parent
f40967784f
commit
035a7ee625
|
@ -222,13 +222,14 @@ module MongoDBModule {
|
||||||
await this.connect()
|
await this.connect()
|
||||||
const db = this.client.db(this.config.db)
|
const db = this.client.db(this.config.db)
|
||||||
const collection = db.collection(query.extra.collection)
|
const collection = db.collection(query.extra.collection)
|
||||||
|
let json = this.createObjectIds(query.json)
|
||||||
|
|
||||||
switch (query.extra.actionTypes) {
|
switch (query.extra.actionTypes) {
|
||||||
case "deleteOne": {
|
case "deleteOne": {
|
||||||
return await collection.deleteOne(query.json)
|
return await collection.deleteOne(json)
|
||||||
}
|
}
|
||||||
case "deleteMany": {
|
case "deleteMany": {
|
||||||
return await collection.deleteMany(query.json).toArray()
|
return await collection.deleteMany(json)
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
|
|
Loading…
Reference in New Issue