$redact can't accept $$DESCEND

XMLWordPrintableJSON

    • ALL
    • Hide

      db.aggregate( [

      { $redact: "$$DESCEND" }

      ] );

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

      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 Stearn
              Reporter:
              Ranjay Krishna (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: