cypress-mongodb
Version:
Cypress MongoDB plugin
19 lines • 571 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.runCommand = runCommand;
const mongodb_1 = require("mongodb");
async function runCommand(args) {
let client = await mongodb_1.MongoClient.connect(args.uri);
const database = client.db(args.database);
if (args.options) {
delete args.options.database;
delete args.options.collection;
}
try {
return await database.command(args.command, args.options);
}
finally {
await client.close();
}
}
//# sourceMappingURL=command.js.map