summaryrefslogtreecommitdiffstats
path: root/node_modules/mongodb/lib/operations/drop.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/mongodb/lib/operations/drop.js')
-rw-r--r--node_modules/mongodb/lib/operations/drop.js53
1 files changed, 0 insertions, 53 deletions
diff --git a/node_modules/mongodb/lib/operations/drop.js b/node_modules/mongodb/lib/operations/drop.js
deleted file mode 100644
index be03716..0000000
--- a/node_modules/mongodb/lib/operations/drop.js
+++ /dev/null
@@ -1,53 +0,0 @@
-'use strict';
-
-const Aspect = require('./operation').Aspect;
-const CommandOperation = require('./command');
-const defineAspects = require('./operation').defineAspects;
-const handleCallback = require('../utils').handleCallback;
-
-class DropOperation extends CommandOperation {
- constructor(db, options) {
- const finalOptions = Object.assign({}, options, db.s.options);
-
- if (options.session) {
- finalOptions.session = options.session;
- }
-
- super(db, finalOptions);
- }
-
- execute(callback) {
- super.execute((err, result) => {
- if (err) return handleCallback(callback, err);
- if (result.ok) return handleCallback(callback, null, true);
- handleCallback(callback, null, false);
- });
- }
-}
-
-defineAspects(DropOperation, Aspect.WRITE_OPERATION);
-
-class DropCollectionOperation extends DropOperation {
- constructor(db, name, options) {
- super(db, options);
-
- this.name = name;
- this.namespace = `${db.namespace}.${name}`;
- }
-
- _buildCommand() {
- return { drop: this.name };
- }
-}
-
-class DropDatabaseOperation extends DropOperation {
- _buildCommand() {
- return { dropDatabase: 1 };
- }
-}
-
-module.exports = {
- DropOperation,
- DropCollectionOperation,
- DropDatabaseOperation
-};