Error generating java code

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Minor - P4
    • No version
    • Affects Version/s: 1.22.1, 1.23.0
    • Component/s: Aggregation pipeline
    • None
    • Not Needed
    • None

      Problem Description

      A valid aggregation pipeline generates the error $eq cannot be top-level" when an attempt is made to export to java

      Steps to Reproduce

      The following test pipeline demonstrates the problem:[{$addFields: {
      "elemZero":

      { $arrayElemAt: ["$LOANMI", 0] }

      ,
      "elemOne":

      { $arrayElemAt: ["$LOANMI", 1] }

      }}, {$group: {
      _id: null,
      "MICancellation": {
      $push: {
      $cond: {
      if: {
      $and: [{
      "$eq": [

      { $ifNull: ["$elemZero", "unspecified"] }

      , "unspecified"]
      },
      {
      "$eq": [

      { $type: "$elemOne" }

      , "date"]
      }
      ]
      },
      then: "$_id",
      else: null
      }
      }
      }
      }}]

      Expected Results

      Java code generated

      Actual Results

      Error message $eq cannot be top-level" is generated.

       

      Additional Notes

      Reported by Customer Freddie Mac

              Assignee:
              Unassigned
              Reporter:
              Peter Williamson
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: