(dbId, params, callback)
| 182 | } |
| 183 | |
| 184 | async function MongoCreateIndex(dbId, params, callback) { |
| 185 | try { |
| 186 | if (typeof callback !== "function") callback = null; |
| 187 | if (typeof params !== "object") return null; |
| 188 | if (typeof params.collection !== "string") return null; |
| 189 | if (typeof params.index !== "object") return null; |
| 190 | const collection = global.MongoConnections[dbId].collection(params.collection) |
| 191 | const result = await collection.createIndex(params.index); |
| 192 | return callback ? callback(result) : result; |
| 193 | } catch (error) { |
| 194 | ParseError("MongoDB create index error catched:", error.message); |
| 195 | return callback ? callback(null) : null; |
| 196 | } |
| 197 | } |
| 198 | |
| 199 | async function MongoStartTransactionSession(dbId, callback) { |
| 200 | try { |
nothing calls this directly
no test coverage detected