[CDRIVER-1493] Flexible index-creation function Created: 26/Aug/16  Updated: 12/Sep/17  Resolved: 10/Aug/17

Status: Closed
Project: C Driver
Component/s: None
Affects Version/s: 1.4.0
Fix Version/s: 1.8.0

Type: New Feature Priority: Major - P3
Reporter: Lucas Morales Assignee: A. Jesse Jiryu Davis
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on CDRIVER-2096 Flexible index-creation Closed
Related
is related to CDRIVER-1372 Support providing collation per opera... Closed

 Description   

Both mongoc_collection_create_index and mongoc_collection_create_index_with_opts take a mongoc_index_opt_t that is an API mistake. Replace with a new function that takes only a collection, index name, arbitrary bson_t options, and an error-out pointer.

Original: "storage engine index options limitation":

The mongoc_index_opt_t field storage_options currently only supports giving a configuration string to the wiredTiger storage engine (no custom storage engine would be able to give options for index creation, and any additions to the wiredTiger index options would have to be supplemented by a change in the driver to support it).

On top of that, it can only be done by casting a mongoc_index_opt_wt_t* to a mongoc_index_opt_storage_t*, and there's no documentation for that process (the source code has to be read to realize this is what needs to be done).

Shouldn't the storage engine options just be a bson_t, as is generated by the driver anyway? e.g. the following could be passed in:
{"wiredTiger": {"configString": "myconfig"}}
rather than:
(mongoc_index_opt_storage_t*)wt_opts



 Comments   
Comment by Ramon Fernandez Marina [ 12/Sep/17 ]

Author:

{'username': u'ajdavis', 'name': u'A. Jesse Jiryu Davis', 'email': u'jesse@mongodb.com'}

Message:deprecate createIndexes helpers

CDRIVER-2096 and CDRIVER-1493
Branch:master
https://github.com/mongodb/mongo-c-driver/commit/48750743091175d771ff4aa7b25097657bda828e

Comment by Githook User [ 11/Aug/17 ]

Author:

{'name': 'A. Jesse Jiryu Davis', 'username': 'ajdavis', 'email': 'jesse@mongodb.com'}

Message: add createIndexes guide

CDRIVER-2096 and CDRIVER-1493
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/ff6b44e9c38b783f4238b55916da0a1677bd3b80

Comment by Githook User [ 11/Aug/17 ]

Author:

{'name': 'A. Jesse Jiryu Davis', 'username': 'ajdavis', 'email': 'jesse@mongodb.com'}

Message: add createIndexes example

CDRIVER-2096 and CDRIVER-1493
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/c0a1afbc4a6a5f7454062fda183329dd768f1c3a

Comment by Hannes Magnusson [ 31/Aug/16 ]

quashi related to CDRIVER-1372 where we have to fix mongoc_collection_create_index () to support collation option..

Generated at Wed Feb 07 21:12:43 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.