(dbId, params, callback)
| 109 | } |
| 110 | |
| 111 | async function MongoUpdateMany(dbId, params, callback) { |
| 112 | try { |
| 113 | if (typeof callback !== "function") callback = null; |
| 114 | const data = await MongoMiddleware(dbId, params); |
| 115 | if (typeof data !== "object") return null; |
| 116 | |
| 117 | const query = PrepareObject(data.params.query); |
| 118 | const update = PrepareObject(data.params.update); |
| 119 | const options = PrepareObject(data.params.options); |
| 120 | |
| 121 | const collection = global.MongoConnections[dbId].collection(params.collection) |
| 122 | const result = await collection.updateMany(query, update, options); |
| 123 | return callback ? callback(result) : result; |
| 124 | } catch (error) { |
| 125 | ParseError("MongoDB find error catched:", error.message); |
| 126 | return callback ? callback(null) : null; |
| 127 | } |
| 128 | } |
| 129 | |
| 130 | async function MongoCount(dbId, params, callback) { |
| 131 | try { |
nothing calls this directly
no test coverage detected