Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-1493

Flexible index-creation function

    • Type: Icon: New Feature New Feature
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.8.0
    • Affects Version/s: 1.4.0
    • Component/s: None
    • None

      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

            Assignee:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Reporter:
            lucas.morales Lucas Morales
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: