Update Ambiguous Top-Level Storage Error For CSLE remove_alt_name

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Won't Fix
    • Priority: Minor - P4
    • None
    • Component/s: Client Side Encryption
    • None
    • Not Needed

      Summary

      Top-level dollar signs are not supported in mongodb versions < 4.2, per the legacy documentation. A recent change to key management API (in DRIVERS-2017) added a dependency on aggregation pipeline style update operators which are not supported until 4.2. Apps that attempt to use removeKeyAltName() on MongoDB <4.2 will receive a cryptic error like this:

      The dollar ($) prefixed field '$set' in '0.$set' is not valid for storage.
      

      This particular error will occur when running something like the following for a mongodb version < 4.2:

      def remove_alt_name(name):
          return coll.find_one_and_update({"keyAltNames": name}, [{"$set": { "x": 1 }}])
      

      One potential update could ensure the resulting error reads

      FLE requires mongodb version 4.2+: The dollar ($) prefixed field '$set' in '0.$set' is not valid for storage.
      

      Motivation

      Who is the affected end user?

      Anyone using version < 4.2 for aggregating data.

      How does this affect the end user?

      Cosmetic, clearer error messages for resolution.

            Assignee:
            Unassigned
            Reporter:
            Preston Vasquez
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: