无法在Jasper Reports中读取带参数化MongoDB查询的字段

时间:2016-09-14 13:10:24

标签: mongodb jasper-reports

我在MongoDB中有以下集合

Collection

我想为每个使用以下查询创建数据集的account创建一个列表

{ runCommand : { aggregate : 'case', 
                pipeline : [ { $project : { accounts : 1 }},
                             { $unwind  : '$accounts'},

                                     ]
           }
}

现在在列表中我想表示表中的transactions数组。我无法弄清楚我应该使用哪种数据集查询。目前我正在使用此

{ runCommand : { aggregate : 'case', 
                pipeline : [ { $project : { accounts : 1 }},
                             { $unwind  : '$accounts'},
                             { $unwind : '$accounts.transactions'},
                             { $match:{'accounts.accountNumber':'$P!{accNumber}'}}
                                     ]
           }
}

在这里,我使用了一个名为accNumber的参数,我将当前的帐号传递到该参数以显示交易。但是,当我在数据集中提供此查询时,它无法读取任何字段。但如果我硬编码实际帐号,它就能读取所有字段。就我而言,没有任何领域,我无法制作我的桌子。有什么建议吗?

0 个答案:

没有答案