Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-4785

add $cond example to the $group stage documentation (aggregation)

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Icon: Trivial - P5 Trivial - P5
    • 01112017-cleanup
    • None
    • None
    • None

    Description

      I was recently trying to determine whether or not I could calculate a sum during an aggregation $group stage, based on certain conditions.

      However, neither the $group, nor the $cond documentation (or $sum, for that matter) make any reference to the fact that this is possible. I think it may be helpful to include an example, or at least to reference that this is in fact possible.

      Attachments

        Activity

          People

            Unassigned Unassigned
            evan.altman@ticketmaster.com Evan Altman
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              9 years, 1 week, 6 days ago