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

$redact can't accept $$DESCEND

    • ALL
    • Hide

      db.aggregate( [

      { $redact: "$$DESCEND" }

      ] );

      Show
      db.aggregate( [ { $redact: "$$DESCEND" } ] );

      In the case where the user wishes to iterate over all the documents and descend down all the subdocuments, $redact fails.

      Consider the following syntax:

      $redact: { $cond: [true, $$DESCEND, $$DESCEND] }
      

      this will get serialized to:

      $redact: $$DESCEND.
      

      However, this fails with the error:

      "exception: $redact specification must be an object".

            Assignee:
            mathias@mongodb.com Mathias Stearn
            Reporter:
            ranjay.krishna Ranjay Krishna
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: