[MONGOCRYPT-431] Preserve $db Created: 18/May/22  Updated: 28/Oct/23  Resolved: 23/May/22

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

Type: Task Priority: Unknown
Reporter: Boris Dogadov Assignee: Kevin Albertson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Scope

  • If $db is included in the input command, preserve it in the output command.
  • If $db is not included in the input command, do not add it to the output command.
  • Always omit the $db to the command for mongocryptd.

Original description
Currently $db is stripped from the encryption result. With mongocryptd, .Net driver added $db field in MONGOCRYPT_CTX_NEED_MONGO_MARKINGS state. Adding an option to preserve $db, would eliminate the serialization roundtrip for adding $db field in .Net driver.
 
/**

  • mongocrypt_ctx_setopt_include_db configures whether $db is included in the final command.
  • If include is true, $db is included in final command.
  • If include is false, $db is excluded in final command.
  • The default behavior is to exclude $db.
    */
    MONGOCRYPT_EXPORT
    bool
    mongocrypt_ctx_setopt_include_db (mongocrypt_ctx_t *ctx, bool include);


 Comments   
Comment by Githook User [ 23/May/22 ]

Author:

{'name': 'Kevin Albertson', 'email': 'kevin.albertson@mongodb.com', 'username': 'kevinAlbs'}

Message: MONGOCRYPT-431 Preserve $db (#343)

Append $db to output if included in input.

Always omit $db from command to mongocryptd.
Branch: master
https://github.com/mongodb/libmongocrypt/commit/374828ea49b5f14c4ef3c57b02f09189219b36b2

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