mongodcryptd should respect whatever fields the caller passes to it, and echo them back unchanged (except for jsonSchema field and the markings, of course), and should not add any additional fields. This gives drivers the most flexibility in terms of the design space for implementation of FLE. Some drivers may be invoking mongocryptd at a layer above where $db and other common fields are added, and some below. By echoing back what the driver provides, it will allow either design to work seamlessly.
Current behavior:
MongoDB Enterprise > db.runCommand({insert : "test", documents : [{}], jsonSchema : {properties : {}}}) { "hasEncryptionPlaceholders" : false, "result" : { "insert" : "test", "bypassDocumentValidation" : false, "ordered" : true, "documents" : [ { } ], "lsid" : { "id" : UUID("a990143c-585b-4be0-ab45-93427f476d12") }, "$db" : "test" }, "ok" : 1 }
Expected behavior:
MongoDB Enterprise > db.runCommand({insert : "test", documents : [{}], jsonSchema : {properties : {}}}) { "hasEncryptionPlaceholders" : false, "result" : { "insert" : "test", "documents" : [ { } ] }, "ok" : 1 }
- is related to
-
SERVER-58293 mongocryptd does not include server API fields in explain command response
- Closed