@@ -1608,7 +1608,9 @@ define.classMethod('createIndex', { callback: true, promise: true });
16081608 */
16091609Collection . prototype . createIndexes = function ( indexSpecs , options , callback ) {
16101610 if ( typeof options === 'function' ) ( callback = options ) , ( options = { } ) ;
1611- options = options || { } ;
1611+
1612+ options = options ? shallowClone ( options ) : { } ;
1613+ if ( typeof options . maxTimeMS !== 'number' ) delete options . maxTimeMS ;
16121614
16131615 return executeOperation ( this . s . topology , createIndexes , [ this , indexSpecs , options , callback ] ) ;
16141616} ;
@@ -1659,6 +1661,7 @@ define.classMethod('createIndexes', { callback: true, promise: true });
16591661 * @param {number } [options.wtimeout=null] The write concern timeout.
16601662 * @param {boolean } [options.j=false] Specify a journal write concern.
16611663 * @param {ClientSession } [options.session] optional session to use for this operation
1664+ * @param {number } [options.maxTimeMS] Number of miliseconds to wait before aborting the query.
16621665 * @param {Collection~resultCallback } [callback] The command result callback
16631666 * @return {Promise } returns Promise if no callback passed
16641667 */
@@ -1695,12 +1698,15 @@ define.classMethod('dropIndex', { callback: true, promise: true });
16951698 * @method
16961699 * @param {Object } [options] Optional settings
16971700 * @param {ClientSession } [options.session] optional session to use for this operation
1701+ * @param {number } [options.maxTimeMS] Number of miliseconds to wait before aborting the query.
16981702 * @param {Collection~resultCallback } [callback] The command result callback
16991703 * @return {Promise } returns Promise if no callback passed
17001704 */
17011705Collection . prototype . dropIndexes = function ( options , callback ) {
17021706 if ( typeof options === 'function' ) ( callback = options ) , ( options = { } ) ;
1703- options = options || { } ;
1707+ options = options ? shallowClone ( options ) : { } ;
1708+
1709+ if ( typeof options . maxTimeMS !== 'number' ) delete options . maxTimeMS ;
17041710
17051711 return executeOperation ( this . s . topology , dropIndexes , [ this , options , callback ] ) ;
17061712} ;
0 commit comments