[DRIVERS-195] Support new storage engine options for createCollection. Created: 20/Nov/14  Updated: 27/May/22  Resolved: 21/Jun/16

Status: Closed
Project: Drivers
Component/s: None
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Bernie Hackett Assignee: Barrie Segal
Resolution: Done Votes: 0
Labels: newdriver
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on CSHARP-1108 Add support for storage options to Cr... Closed
depends on RUST-155 Support new storage engine options fo... Closed
depends on PYTHON-792 Update create_collection, create_inde... Closed
depends on RUBY-837 Update create_collection, create_inde... Closed
depends on CDRIVER-471 Add support for storage options to co... Closed
depends on SERVER-16137 Validate collection options for all r... Closed
Related
related to PHPLIB-64 Collection creation method Closed
related to DRIVERS-194 add support for storage options to cr... Closed
Server Compat: 2.8
Driver Compliance:
Key Status/Resolution FixVersion
CSHARP-1108 Done 1.10, 2.0
PYTHON-792 Done 2.8, 3.0
RUBY-837 Done 1.12, 2.0.0
CDRIVER-471 Done 1.1.0
RUST-155 Fixed 0.9.0-alpha
SWIFT-466 Done

 Description   

Similar to DRIVERS-194. Drivers that provide a createCollection or similar helper must support the new createCollection command options added in MongoDB 2.8. Drivers that already accept arbitrary options for these helpers only have to review and adjust documentation. Drivers that have builders or validate all options will have to add explicit support.

See SERVER-16137 for more information.

Since the server does not report an error on an invalid field in the createCollection command, if you want to validate you have to use the listCollections command, e.g.

> db.createCollection('test', {storageEngine: {wiredTiger: {configString: 'block_compressor=zlib'}}})
{ "ok" : 1 }
> db.runCommand('listCollections')
{
	"collections" : [
		{
			"name" : "system.indexes",
			"options" : {
 
			}
		},
		{
			"name" : "test",
			"options" : {
				"flags" : 1,
				"storageEngine" : {
					"wiredTiger" : {
						"configString" : "block_compressor=zlib"
					}
				}
			}
		}
	],
	"ok" : 1
}



 Comments   
Comment by Andrew Morrow (Inactive) [ 03/Mar/15 ]

Validating for C++11 since validated for C

Comment by Andrew Morrow (Inactive) [ 25/Nov/14 ]

The legacy C++ driver offers a createCollection helper, but it has an overload that accepts arbitrary BSON, so there is no work to be done here: https://github.com/mongodb/mongo-cxx-driver/blob/c455cd0b305c2626a20ebbcfc191f76460384826/src/mongo/client/dbclientinterface.h#L799

Comment by Derick Rethans [ 25/Nov/14 ]

I've updated the docs, and pointing back to the createCollection MongoDB docs:

http://news.php.net/php.doc.cvs/12936

Generated at Thu Feb 08 08:20:58 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.