Skip to content

Commit

Permalink
doc(sessions): add gridfs session documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
mbroadst committed Nov 3, 2017
1 parent 1ae42ae commit b975df1
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/db.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down Expand Up @@ -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) {
Expand Down
29 changes: 29 additions & 0 deletions lib/gridfs/grid_store.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
*/
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit b975df1

Please sign in to comment.