Skip to content

Commit 8f768ef

Browse files
committed
updated createCollection doc options and linked to create command
1 parent 897dabc commit 8f768ef

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

lib/db.js

+10-1
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,7 @@ var createCollection = function(self, name, options, callback) {
539539

540540
/**
541541
* Create a new collection on a server with the specified options. Use this to create capped collections.
542+
* More information about command options available at https://docs.mongodb.com/manual/reference/command/create/
542543
*
543544
* @method
544545
* @param {string} name the collection name we wish to access.
@@ -552,9 +553,17 @@ var createCollection = function(self, name, options, callback) {
552553
* @param {boolean} [options.serializeFunctions=false] Serialize functions on any object.
553554
* @param {boolean} [options.strict=false] Returns an error if the collection does not exist
554555
* @param {boolean} [options.capped=false] Create a capped collection.
556+
* @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.
555557
* @param {number} [options.size=null] The size of the capped collection in bytes.
556558
* @param {number} [options.max=null] The maximum number of documents in the capped collection.
557-
* @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.
559+
* @param {number} [options.flags=null] Optional. Available for the MMAPv1 storage engine only to set the usePowerOf2Sizes and the noPadding flag.
560+
* @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.
561+
* @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.
562+
* @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.
563+
* @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.
564+
* @param {object} [options.indexOptionDefaults=null] Allows users to specify a default configuration for indexes when creating a collection on MongoDB 3.2 or higher.
565+
* @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.
566+
* @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.
558567
* @param {object} [options.collation=null] Specify collation (MongoDB 3.4 or higher) settings for update operation (see 3.4 documentation for available fields).
559568
* @param {Db~collectionResultCallback} [callback] The results callback
560569
* @return {Promise} returns Promise if no callback passed

0 commit comments

Comments
 (0)