MCPcopy Create free account
hub / github.com/IceClusters/icmysql / MongoCreateIndex

Function MongoCreateIndex

src/db/mongo/Query.js:184–197  ·  view source on GitHub ↗
(dbId, params, callback)

Source from the content-addressed store, hash-verified

182}
183
184async 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
199async function MongoStartTransactionSession(dbId, callback) {
200 try {

Callers

nothing calls this directly

Calls 1

ParseErrorFunction · 0.85

Tested by

no test coverage detected