Skip to content

Commit 9cade0d

Browse files
committed
fix killCursor issue
1 parent 6ba3593 commit 9cade0d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/core/wireprotocol/kill_cursors.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,12 @@ const maxWireVersion = require('../utils').maxWireVersion;
88
const emitWarning = require('../utils').emitWarning;
99
const command = require('./command');
1010

11-
function killCursors(server, ns, cursorState, options, callback) {
11+
function killCursors(server, ns, cursorState, defaultOptions, callback) {
12+
if (typeof defaultOptions === 'function') {
13+
callback = defaultOptions;
14+
defaultOptions = {};
15+
}
1216
callback = typeof callback === 'function' ? callback : () => {};
13-
options = options || {};
1417

1518
const cursorId = cursorState.cursorId;
1619

@@ -47,6 +50,7 @@ function killCursors(server, ns, cursorState, options, callback) {
4750
cursors: [cursorId]
4851
};
4952

53+
const options = defaultOptions || {};
5054
if (typeof cursorState.session === 'object') options.session = cursorState.session;
5155

5256
command(server, ns, killCursorCmd, options, (err, result) => {

0 commit comments

Comments
 (0)