Uploaded image for project: 'Libmongocrypt'
  1. Libmongocrypt
  2. MONGOCRYPT-441

Accept string values for QueryType and IndexType

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 1.5.0-rc2
    • Affects Version/s: None
    • Component/s: None
    • None
    • Needed

      Scope

      • Allow IndexType option to be set as a string. Accept the values "Indexed" and "Unindexed".
        • Consider extending mongocrypt_ctx_setopt_algorithm to accept "Indexed" and "Unindexed".
      • Allow QueryType option to be set as a string. Accept the values "equality".
      • Consider adding a new function to set all explicit encryption options as a BSON document.

      Background & Motivation

      The current driver API accepts string values for EncryptOpts.algorithm "Indexed" and "Unindexed". The driver passes this to libmongocrypt using an enum value in mongocrypt_ctx_setopt_index_type.

      The current driver API uses an enum for QueryType. This is passed to libmongocrypt using an enum value in mongocrypt_ctx_setopt_query_type.

      Accepting string values in the driver API, and forwarding those string values to libmongocrypt API helps with forward compatibility. When new values of QueryType and IndexType are added in libmongocrypt, users would only need to upgrade libmongocrypt, and not the driver, to use the new values.

            Assignee:
            colby.pike@mongodb.com Colby Pike
            Reporter:
            kevin.albertson@mongodb.com Kevin Albertson
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: