[MONGOCRYPT-441] Accept string values for QueryType and IndexType Created: 09/Jun/22  Updated: 25/Jun/22  Resolved: 16/Jun/22

Status: Closed
Project: Libmongocrypt
Component/s: None
Affects Version/s: None
Fix Version/s: 1.5.0-rc2

Type: Improvement Priority: Minor - P4
Reporter: Kevin Albertson Assignee: Colby Pike
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by DRIVERS-2352 EncryptOpts queryType should accept a... Implementing
Duplicate
is duplicated by CSHARP-4204 EncryptOpts queryType should accept a... Closed
is duplicated by PYTHON-3301 EncryptOpts queryType should accept a... Closed
Issue split
split to CSHARP-4207 Accept string values for QueryType an... Closed
split to JAVA-4644 Accept string values for QueryType an... Closed
split to NODE-4304 Accept string values for QueryType an... Closed
split to PYTHON-3302 Accept string values for QueryType an... Closed
Problem/Incident
causes PYTHON-3310 Test Failure - query_type must be str... Closed
Binding Changes: Needed

 Description   

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.



 Comments   
Comment by Githook User [ 20/Jun/22 ]

Author:

{'name': 'Anna Henningsen', 'email': 'anna@addaleax.net', 'username': 'addaleax'}

Message: chore(NODE-4304): accept string value for queryType (#373)

MONGOCRYPT-441 has no impact besides updating `equality` to
be spelled lowercase.
Branch: master
https://github.com/mongodb/libmongocrypt/commit/b5a7a2a723c7a29e5e694e84372e1b843781d3e8

Comment by Githook User [ 17/Jun/22 ]

Author:

{'name': 'vector-of-bool', 'email': 'vectorofbool@gmail.com', 'username': 'vector-of-bool'}

Message: MONGOCRYPT-441: Update use of removed API (#370)

Update use of removed API
Branch: master
https://github.com/mongodb/libmongocrypt/commit/638b8090b971bbbfc396c4c31e4d66cd7e11668b

Comment by Githook User [ 16/Jun/22 ]

Author:

{'name': 'vector-of-bool', 'email': 'vectorofbool@gmail.com', 'username': 'vector-of-bool'}

Message: MONGOCRYPT-441 Accept string arguments for queryType and "index_type" (#368)

Comment by Jeremy Mikola [ 09/Jun/22 ]

In DRIVERS-2352, I suggest that EncryptOpts accept the same string value for queryType that the server accepts within encryptedFields. This would be "equality" (lowercase), and cause less confusion should users attempt to use a constant defined for EncryptOpts in encryptedFields.

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