drop_indexes.js 637 B

1234567891011121314151617181920212223
  1. 'use strict';
  2. const Aspect = require('./operation').Aspect;
  3. const defineAspects = require('./operation').defineAspects;
  4. const DropIndexOperation = require('./drop_index');
  5. const handleCallback = require('../utils').handleCallback;
  6. class DropIndexesOperation extends DropIndexOperation {
  7. constructor(collection, options) {
  8. super(collection, '*', options);
  9. }
  10. execute(callback) {
  11. super.execute(err => {
  12. if (err) return handleCallback(callback, err, false);
  13. handleCallback(callback, null, true);
  14. });
  15. }
  16. }
  17. defineAspects(DropIndexesOperation, Aspect.WRITE_OPERATION);
  18. module.exports = DropIndexesOperation;