diff --git a/lib/db.js b/lib/db.js index c4d30b2fd3..f622e79edd 100644 --- a/lib/db.js +++ b/lib/db.js @@ -539,6 +539,7 @@ var createCollection = function(self, name, options, callback) { /** * Create a new collection on a server with the specified options. Use this to create capped collections. + * More information about command options available at https://docs.mongodb.com/manual/reference/command/create/ * * @method * @param {string} name the collection name we wish to access. @@ -552,9 +553,17 @@ var createCollection = function(self, name, options, callback) { * @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 {boolean} [options.capped=false] Create a capped collection. + * @param {boolean} [options.autoIndexId=true] Create an index on the _id field of the document, True by default on MongoDB 2.2 or higher off for version < 2.2. * @param {number} [options.size=null] The size of the capped collection in bytes. * @param {number} [options.max=null] The maximum number of documents in the capped collection. - * @param {boolean} [options.autoIndexId=true] Create an index on the _id field of the document, True by default on MongoDB 2.2 or higher off for version < 2.2. + * @param {number} [options.flags=null] Optional. Available for the MMAPv1 storage engine only to set the usePowerOf2Sizes and the noPadding flag. + * @param {object} [options.storageEngine=null] Allows users to specify configuration to the storage engine on a per-collection basis when creating a collection on MongoDB 3.0 or higher. + * @param {object} [options.validator=null] Allows users to specify validation rules or expressions for the collection. For more information, see Document Validation on MongoDB 3.2 or higher. + * @param {string} [options.validationLevel=null] Determines how strictly MongoDB applies the validation rules to existing documents during an update on MongoDB 3.2 or higher. + * @param {string} [options.validationAction=null] Determines whether to error on invalid documents or just warn about the violations but allow invalid documents to be inserted on MongoDB 3.2 or higher. + * @param {object} [options.indexOptionDefaults=null] Allows users to specify a default configuration for indexes when creating a collection on MongoDB 3.2 or higher. + * @param {string} [options.viewOn=null] The name of the source collection or view from which to create the view. The name is not the full namespace of the collection or view; i.e. does not include the database name and implies the same database as the view to create on MongoDB 3.4 or higher. + * @param {array} [options.pipeline=null] An array that consists of the aggregation pipeline stage. create creates the view by applying the specified pipeline to the viewOn collection or view on MongoDB 3.4 or higher. * @param {object} [options.collation=null] Specify collation (MongoDB 3.4 or higher) settings for update operation (see 3.4 documentation for available fields). * @param {Db~collectionResultCallback} [callback] The results callback * @return {Promise} returns Promise if no callback passed