diff --git a/lib/db.js b/lib/db.js index d077fd0051..c5ccdd9ad8 100644 --- a/lib/db.js +++ b/lib/db.js @@ -626,6 +626,7 @@ define.classMethod('createCollection', { callback: true, promise: true }); * @method * @param {object} [options=null] Optional settings. * @param {number} [options.scale=null] Divide the returned sizes by scale value. + * @param {ClientSession} [options.session] optional session to use for this operation * @param {Db~resultCallback} [callback] The collection result callback * @return {Promise} returns Promise if no callback passed */ @@ -673,6 +674,7 @@ var listCollectionsTranforms = function(databaseName) { * @param {object} [options=null] Optional settings. * @param {number} [options.batchSize=null] The batchSize for the returned command cursor or if pre 2.8 the systems batch collection * @param {(ReadPreference|string)} [options.readPreference=null] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST). + * @param {ClientSession} [options.session] optional session to use for this operation * @return {CommandCursor} */ Db.prototype.listCollections = function(filter, options) { diff --git a/lib/gridfs/grid_store.js b/lib/gridfs/grid_store.js index e9bf8bbc94..bad7bfd756 100644 --- a/lib/gridfs/grid_store.js +++ b/lib/gridfs/grid_store.js @@ -187,6 +187,8 @@ var define = (GridStore.define = new Define('Gridstore', GridStore, true)); * new one if file does not exist. * * @method + * @param {object} [options] Optional settings + * @param {ClientSession} [options.session] optional session to use for this operation * @param {GridStore~openCallback} [callback] this will be called after executing this method * @return {Promise} returns Promise if no callback passed * @deprecated Use GridFSBucket API instead @@ -256,6 +258,8 @@ define.classMethod('eof', { callback: false, promise: false, returns: [Boolean] /** * The callback result format. * @callback GridStore~resultCallback + * @param {object} [options] Optional settings + * @param {ClientSession} [options.session] optional session to use for this operation * @param {MongoError} error An error instance representing the error during the execution. * @param {object} result The result from the callback. */ @@ -298,6 +302,8 @@ define.classMethod('getc', { callback: true, promise: true }); * * @method * @param {string} string the string to write. + * @param {object} [options] Optional settings + * @param {ClientSession} [options.session] optional session to use for this operation * @param {GridStore~resultCallback} [callback] this will be called after executing this method. The first parameter will contain null and the second one will contain a reference to this object. * @return {Promise} returns Promise if no callback passed * @deprecated Use GridFSBucket API instead @@ -335,6 +341,8 @@ define.classMethod('stream', { callback: false, promise: false, returns: [GridSt * @method * @param {(string|Buffer)} data the data to write. * @param {boolean} [close] closes this file after writing if set to true. + * @param {object} [options] Optional settings + * @param {ClientSession} [options.session] optional session to use for this operation * @param {GridStore~resultCallback} [callback] this will be called after executing this method. The first parameter will contain null and the second one will contain a reference to this object. * @return {Promise} returns Promise if no callback passed * @deprecated Use GridFSBucket API instead @@ -373,6 +381,8 @@ define.classMethod('destroy', { callback: false, promise: false }); * * @method * @param {(string|Buffer|FileHandle)} file the file to store. + * @param {object} [options] Optional settings + * @param {ClientSession} [options.session] optional session to use for this operation * @param {GridStore~resultCallback} [callback] this will be called after executing this method. The first parameter will contain null and the second one will contain a reference to this object. * @return {Promise} returns Promise if no callback passed * @deprecated Use GridFSBucket API instead @@ -456,6 +466,8 @@ define.classMethod('writeFile', { callback: true, promise: true }); * "w" or "w+". * * @method + * @param {object} [options] Optional settings + * @param {ClientSession} [options.session] optional session to use for this operation * @param {GridStore~resultCallback} [callback] this will be called after executing this method. The first parameter will contain null and the second one will contain a reference to this object. * @return {Promise} returns Promise if no callback passed * @deprecated Use GridFSBucket API instead @@ -559,6 +571,8 @@ define.classMethod('chunkCollection', { callback: true, promise: false, returns: * Deletes all the chunks of this file in the database. * * @method + * @param {object} [options] Optional settings + * @param {ClientSession} [options.session] optional session to use for this operation * @param {GridStore~resultCallback} [callback] the command callback. * @return {Promise} returns Promise if no callback passed * @deprecated Use GridFSBucket API instead @@ -619,6 +633,8 @@ define.classMethod('collection', { callback: true, promise: false, returns: [Col * * @method * @param {string} [separator] The character to be recognized as the newline separator. + * @param {object} [options] Optional settings + * @param {ClientSession} [options.session] optional session to use for this operation * @param {GridStore~readlinesCallback} [callback] the command callback. * @return {Promise} returns Promise if no callback passed * @deprecated Use GridFSBucket API instead @@ -654,6 +670,8 @@ define.classMethod('readlines', { callback: true, promise: true }); * "w+" and resets the read/write head to the initial position. * * @method + * @param {object} [options] Optional settings + * @param {ClientSession} [options.session] optional session to use for this operation * @param {GridStore~resultCallback} [callback] this will be called after executing this method. The first parameter will contain null and the second one will contain a reference to this object. * @return {Promise} returns Promise if no callback passed * @deprecated Use GridFSBucket API instead @@ -711,6 +729,8 @@ define.classMethod('rewind', { callback: true, promise: true }); * @method * @param {number} [length] the number of characters to read. Reads all the characters from the read/write head to the EOF if not specified. * @param {(string|Buffer)} [buffer] a string to hold temporary data. This is used for storing the string data read so far when recursively calling this method. + * @param {object} [options] Optional settings + * @param {ClientSession} [options.session] optional session to use for this operation * @param {GridStore~readCallback} [callback] the command callback. * @return {Promise} returns Promise if no callback passed * @deprecated Use GridFSBucket API instead @@ -790,6 +810,8 @@ define.classMethod('read', { callback: true, promise: true }); * @method * @param {number} [length] the number of characters to read. Reads all the characters from the read/write head to the EOF if not specified. * @param {(string|Buffer)} [buffer] a string to hold temporary data. This is used for storing the string data read so far when recursively calling this method. + * @param {object} [options] Optional settings + * @param {ClientSession} [options.session] optional session to use for this operation * @param {GridStore~tellCallback} [callback] the command callback. * @return {Promise} returns Promise if no callback passed * @deprecated Use GridFSBucket API instead @@ -826,6 +848,8 @@ define.classMethod('tell', { callback: true, promise: true }); * @method * @param {number} [position] the position to seek to * @param {number} [seekLocation] seek mode. Use one of the Seek Location modes. + * @param {object} [options] Optional settings + * @param {ClientSession} [options.session] optional session to use for this operation * @param {GridStore~gridStoreCallback} [callback] the command callback. * @return {Promise} returns Promise if no callback passed * @deprecated Use GridFSBucket API instead @@ -1259,6 +1283,7 @@ GridStore.IO_SEEK_END = 2; * @param {object} [options=null] Optional settings. * @param {(ReadPreference|string)} [options.readPreference=null] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST). * @param {object} [options.promiseLibrary=null] A Promise library class the application wishes to use such as Bluebird, must be ES6 compatible + * @param {ClientSession} [options.session] optional session to use for this operation * @param {GridStore~resultCallback} [callback] result from exists. * @return {Promise} returns Promise if no callback passed * @deprecated Use GridFSBucket API instead @@ -1324,6 +1349,7 @@ define.staticMethod('exist', { callback: true, promise: true }); * @param {object} [options=null] Optional settings. * @param {(ReadPreference|string)} [options.readPreference=null] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST). * @param {object} [options.promiseLibrary=null] A Promise library class the application wishes to use such as Bluebird, must be ES6 compatible + * @param {ClientSession} [options.session] optional session to use for this operation * @param {GridStore~resultCallback} [callback] result from exists. * @return {Promise} returns Promise if no callback passed * @deprecated Use GridFSBucket API instead @@ -1391,6 +1417,7 @@ define.staticMethod('list', { callback: true, promise: true }); * @param {object} [options=null] Optional settings. * @param {(ReadPreference|string)} [options.readPreference=null] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST). * @param {object} [options.promiseLibrary=null] A Promise library class the application wishes to use such as Bluebird, must be ES6 compatible + * @param {ClientSession} [options.session] optional session to use for this operation * @param {GridStore~readCallback} [callback] the command callback. * @return {Promise} returns Promise if no callback passed * @deprecated Use GridFSBucket API instead @@ -1441,6 +1468,7 @@ define.staticMethod('read', { callback: true, promise: true }); * @param {object} [options=null] Optional settings. * @param {(ReadPreference|string)} [options.readPreference=null] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST). * @param {object} [options.promiseLibrary=null] A Promise library class the application wishes to use such as Bluebird, must be ES6 compatible + * @param {ClientSession} [options.session] optional session to use for this operation * @param {GridStore~readlinesCallback} [callback] the command callback. * @return {Promise} returns Promise if no callback passed * @deprecated Use GridFSBucket API instead @@ -1474,6 +1502,7 @@ define.staticMethod('readlines', { callback: true, promise: true }); * @param {(string|array)} names The name/names of the files to delete. * @param {object} [options=null] Optional settings. * @param {object} [options.promiseLibrary=null] A Promise library class the application wishes to use such as Bluebird, must be ES6 compatible + * @param {ClientSession} [options.session] optional session to use for this operation * @param {GridStore~resultCallback} [callback] the command callback. * @return {Promise} returns Promise if no callback passed * @deprecated Use GridFSBucket API instead