get_more.js 1.1 KB

12345678910111213141516171819202122232425262728
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.GetMoreOperation = void 0;
  4. const error_1 = require("../error");
  5. const operation_1 = require("./operation");
  6. /** @internal */
  7. class GetMoreOperation extends operation_1.AbstractOperation {
  8. constructor(ns, cursorId, server, options = {}) {
  9. super(options);
  10. this.options = options;
  11. this.ns = ns;
  12. this.cursorId = cursorId;
  13. this.server = server;
  14. }
  15. /**
  16. * Although there is a server already associated with the get more operation, the signature
  17. * for execute passes a server so we will just use that one.
  18. */
  19. execute(server, session, callback) {
  20. if (server !== this.server) {
  21. return callback(new error_1.MongoRuntimeError('Getmore must run on the same server operation began on'));
  22. }
  23. server.getMore(this.ns, this.cursorId, this.options, callback);
  24. }
  25. }
  26. exports.GetMoreOperation = GetMoreOperation;
  27. (0, operation_1.defineAspects)(GetMoreOperation, [operation_1.Aspect.READ_OPERATION, operation_1.Aspect.CURSOR_ITERATING]);
  28. //# sourceMappingURL=get_more.js.map