Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) Safe-mode: OFF (not secure) /var/www/html/wincloud_gateway/node_modules/mongodb/lib/operations/ drwxr-xr-x | |
| Viewing file: Select action/file-type: 'use strict';
const Aspect = {
READ_OPERATION: Symbol('READ_OPERATION'),
WRITE_OPERATION: Symbol('WRITE_OPERATION'),
RETRYABLE: Symbol('RETRYABLE'),
EXECUTE_WITH_SELECTION: Symbol('EXECUTE_WITH_SELECTION'),
NO_INHERIT_OPTIONS: Symbol('NO_INHERIT_OPTIONS')
};
/**
* This class acts as a parent class for any operation and is responsible for setting this.options,
* as well as setting and getting a session.
* Additionally, this class implements `hasAspect`, which determines whether an operation has
* a specific aspect.
*/
class OperationBase {
constructor(options) {
this.options = Object.assign({}, options);
}
hasAspect(aspect) {
if (this.constructor.aspects == null) {
return false;
}
return this.constructor.aspects.has(aspect);
}
set session(session) {
Object.assign(this.options, { session });
}
get session() {
return this.options.session;
}
clearSession() {
delete this.options.session;
}
get canRetryRead() {
return true;
}
execute() {
throw new TypeError('`execute` must be implemented for OperationBase subclasses');
}
}
function defineAspects(operation, aspects) {
if (!Array.isArray(aspects) && !(aspects instanceof Set)) {
aspects = [aspects];
}
aspects = new Set(aspects);
Object.defineProperty(operation, 'aspects', {
value: aspects,
writable: false
});
return aspects;
}
module.exports = {
Aspect,
defineAspects,
OperationBase
};
|
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0176 ]-- |