Skip to content

Commit

Permalink
docs(readConcern): update all possible readConcern levels
Browse files Browse the repository at this point in the history
Part of NODE-1628
  • Loading branch information
daprahamian committed Apr 4, 2019
1 parent 1f8e7fa commit 61e5bcb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/db.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ const legalOptionNames = [
* @param {object} [options.pkFactory] A primary key factory object for generation of custom _id keys.
* @param {object} [options.promiseLibrary] A Promise library class the application wishes to use such as Bluebird, must be ES6 compatible
* @param {object} [options.readConcern] Specify a read concern for the collection. (only MongoDB 3.2 or higher supported)
* @param {object} [options.readConcern.level='local'] Specify a read concern level for the collection operations, one of [local|majority]. (only MongoDB 3.2 or higher supported)
* @param {ReadConcernLevel} [options.readConcern.level='local'] Specify a read concern level for the collection operations (only MongoDB 3.2 or higher supported)
* @property {(Server|ReplSet|Mongos)} serverConfig Get the current db topology.
* @property {number} bufferMaxEntries Current bufferMaxEntries value for the database
* @property {string} databaseName The name of the database this instance represents.
Expand Down Expand Up @@ -355,7 +355,7 @@ const collectionKeys = [
* @param {boolean} [options.serializeFunctions=false] Serialize functions on any object.
* @param {boolean} [options.strict=false] Returns an error if the collection does not exist
* @param {object} [options.readConcern] Specify a read concern for the collection. (only MongoDB 3.2 or higher supported)
* @param {object} [options.readConcern.level='local'] Specify a read concern level for the collection operations, one of [local|majority]. (only MongoDB 3.2 or higher supported)
* @param {ReadConcernLevel} [options.readConcern.level='local'] Specify a read concern level for the collection operations (only MongoDB 3.2 or higher supported)
* @param {Db~collectionResultCallback} [callback] The collection result callback
* @return {Collection} return the new Collection instance if not in strict mode
*/
Expand Down
10 changes: 8 additions & 2 deletions lib/mongo_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ const closeOperation = require('./operations/mongo_client_ops').closeOperation;
* });
*/

/**
* A string specifying the level of a ReadConcern
* @typedef {'local'|'available'|'majority'|'linearizable'|'snapshot'} ReadConcernLevel
* @see https://docs.mongodb.com/manual/reference/read-concern/index.html#read-concern-levels
*/

/**
* Creates a new MongoClient instance
* @class
Expand Down Expand Up @@ -88,7 +94,7 @@ const closeOperation = require('./operations/mongo_client_ops').closeOperation;
* @param {object} [options.pkFactory] A primary key factory object for generation of custom _id keys
* @param {object} [options.promiseLibrary] A Promise library class the application wishes to use such as Bluebird, must be ES6 compatible
* @param {object} [options.readConcern] Specify a read concern for the collection (only MongoDB 3.2 or higher supported)
* @param {string} [options.readConcern.level='local'] Specify a read concern level for the collection operations, one of [local|majority]. (only MongoDB 3.2 or higher supported)
* @param {ReadConcernLevel} [options.readConcern.level='local'] Specify a read concern level for the collection operations (only MongoDB 3.2 or higher supported)
* @param {number} [options.maxStalenessSeconds=undefined] The max staleness to secondary reads (values under 10 seconds cannot be guaranteed)
* @param {string} [options.loggerLevel=undefined] The logging level (error/warn/info/debug)
* @param {object} [options.logger=undefined] Custom logger object
Expand Down Expand Up @@ -300,7 +306,7 @@ MongoClient.prototype.isConnected = function(options) {
* @param {object} [options.pkFactory] A primary key factory object for generation of custom _id keys
* @param {object} [options.promiseLibrary] A Promise library class the application wishes to use such as Bluebird, must be ES6 compatible
* @param {object} [options.readConcern] Specify a read concern for the collection (only MongoDB 3.2 or higher supported)
* @param {string} [options.readConcern.level='local'] Specify a read concern level for the collection operations, one of [local|majority]. (only MongoDB 3.2 or higher supported)
* @param {ReadConcernLevel} [options.readConcern.level='local'] Specify a read concern level for the collection operations (only MongoDB 3.2 or higher supported)
* @param {number} [options.maxStalenessSeconds=undefined] The max staleness to secondary reads (values under 10 seconds cannot be guaranteed)
* @param {string} [options.loggerLevel=undefined] The logging level (error/warn/info/debug)
* @param {object} [options.logger=undefined] Custom logger object
Expand Down

0 comments on commit 61e5bcb

Please sign in to comment.