Initial Commit

This commit is contained in:
2020-07-08 15:37:09 +02:00
commit 549ecd137f
1746 changed files with 292109 additions and 0 deletions

31
node_modules/mongodb/lib/operations/profiling_level.js generated vendored Normal file
View File

@@ -0,0 +1,31 @@
'use strict';
const CommandOperation = require('./command');
class ProfilingLevelOperation extends CommandOperation {
constructor(db, command, options) {
super(db, options);
}
_buildCommand() {
const command = { profile: -1 };
return command;
}
execute(callback) {
super.execute((err, doc) => {
if (err == null && doc.ok === 1) {
const was = doc.was;
if (was === 0) return callback(null, 'off');
if (was === 1) return callback(null, 'slow_only');
if (was === 2) return callback(null, 'all');
return callback(new Error('Error: illegal profiling level value ' + was), null);
} else {
err != null ? callback(err, null) : callback(new Error('Error with profile command'), null);
}
});
}
}
module.exports = ProfilingLevelOperation;