Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-64357

Server-side rewrite for findAndModify command on mongos

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Fully Compatible
    • QO 2022-03-21, QO 2022-04-04, QO 2022-04-18
    • 163

      From the design:

      findAndModify commands are minimally rewritten before being more-or-less "blindly" passed on to the relevant shard, since the query must have an equality condition on the shard key in order to precisely target a single shard. We will have to do some more processing than for the find() command because the command BSON is not fully parsed. If there may be FLE2 rewrites to be done and we are inside of a transaction, we will add this procedure after the first rewrite:

      1. Inspect the command BSON to determine if there may be rewrites to be done
      2. Parse the "query" sub-object into a MatchExpression
      3. Rewrite the parsed query using rewriteQueryOnEncryptedFields()
      4. Serialized rewritten MatchExpression to BSON
      5. Replace "query" sub-object of command with the rewritten MatchExpression.

            Assignee:
            nicholas.zolnierz@mongodb.com Nicholas Zolnierz
            Reporter:
            davis.haupt@mongodb.com Davis Haupt (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: