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

Unclear how to use $cond and $ifnull aggregation operators

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • None

    Description

      http://docs.mongodb.org/manual/reference/aggregation/#conditional-expressions

      The documentation refers to "boolean-expression", "true-case", "false-case" for $cond and "expression", "replacement-if-null" for $ifNull.

      Are these types strings that contain javascript expressions? Are document elements usable as inputs? If documents being aggregated on are not available, what can this be used for? A non-trivial example usage would definitely go a long way.

      Attachments

        Activity

          People

            zack.brown@10gen.com Zack Brown
            daniel.gottlieb@mongodb.com Daniel Gottlieb (Inactive)
            Votes:
            3 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              10 years, 20 weeks, 6 days ago