Background & Motivation
The current expectations of the "explain" command differ between csfle and mongocryptd.
mongocryptd expects "encryptionInformation" as a sibling of "explain":
{ "explain": { "find": "foo" }, "encryptionInformation": { "fields": [] }, "$db": "db" // Appended by driver. }
csfle expects "encryptionInformation" nested in "explain":
{ "explain": { "find": "foo", "encryptionInformation": { "fields": [] }, "$db": "db" }, "$db": "db" }
mongocryptd and csfle return "encryptionInformation" nested in "explain". Neither csfle nor mongocryptd return "$db" in the reply.
csfle requires a "$db" field be nested in the "explain" document matching the top-level "$db".
mongod and mongos expect "encryptionInformation" nested in "explain".
This is not urgent. libmongocrypt works around this in MONGOCRYPT-427. The consistent behavior would help simplify libmongocrypt auto encryption logic.
Proposed Scope
- csfle should parse "encryptionInformation" as either a sibling of "explain" or nested inside "explain". Allowing both supports the old behavior and new behavior.
- csfle should not require "$db" nested inside "explain".
- is depended on by
-
MONGOCRYPT-462 Remove workarounds for explain differences between crypt_shared and mongocryptd
- Backlog
- is related to
-
MONGOCRYPT-427 Fix explain for FLE1 with csfle and FLE2
- Closed