Uploaded image for project: 'Compass '
  1. Compass
  2. COMPASS-3663

Infinity/-Infinity cannot be used as value of expression in operation/exp editor

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor - P4 Minor - P4
    • None
    • 1.17.0
    • Compass
    • None
    • mac os/Mojave 10.14.5

    Description

      Go to editor, for example within Aggregations tab to create new aggregation pipeline.

      Add any valid expression that accepts numeric values as value for expression (some code removed for brevity):

       

       

      // code placeholder
      /**
       * specifications - The fields to
       *   include or exclude.
       */
      {
        _id: 0,
        max_height: {
          $reduce: {
            input: "validfield",
            initialValue: -Infinity,
            in: "validfield
          }
        }
      }
      

      The Compass editor does not allow to use Infinity/-Infinity as valid expression value and outputs:

       

       

      Expected "[" or AggregationStage but "{" found.
      

      The sample code is used on Chapter 3 of MongoDB University aggregation framework course

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            peter.blazejewicz@gmail.com Piotr Blazejewicz
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: