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
|