I'm trying to make a report widget that shows only a part of the data I have in a collection. In order to do that, I'm doing something like this:
var my_pipelines = [
{
"$group" : {
"_id" : {
"subproducto" : "$subproducto",
"codigo" : "$codigo",
"stock" : "$stock"
}
}
},
{
"$project" : {
"SUBPRODUCTO" : "$_id.subproducto",
"CODIGO" : "$_id.codigo",
"STOCK" : "$_id.stock"
}
}
];
id_agregation.setAggregate(JSON.stringify(my_pipelines));
id_agregation.refresh();
where id_agregation is the id of the widget report.
For assuring that my pipelines are correct, I have added this code too, just below the previous code:
function callbackSuccess(result) {
console.log("OK " + JSON.stringify(result));
console.log(result);
}
function callbackFailure(result) {
console.log(result);
}
col_insumos.aggregateCallback(my_pipelines,{},callbackSuccess,callbackFailure);
The result of my query is something like that:
OK [{"SUBPRODUCTO":"ACUSE DE RECIBO","CODIGO":"N/A","STOCK":"N/A"},{"SUBPRODUCTO":"BOLSA SEGURISELLO","CODIGO":"N/A","STOCK":"N/A"},{"SUBPRODUCTO":"SOBRE","CODIGO":"EP-0046","STOCK":"473513"},{"SUBPRODUCTO":"WELCOME","CODIGO":"N/A","STOCK":"N/A"},{"SUBPRODUCTO":"FLYER","CODIGO":"N/A","STOCK":"N/A"},{"SUBPRODUCTO":"CONTENEDOR","CODIGO":"EP-0411","STOCK":"267094"},{"SUBPRODUCTO":"WELCOME","CODIGO":"EP-0351","STOCK":"26863"},{"SUBPRODUCTO":"SOBRE","CODIGO":"EP-0081","STOCK":"473531"},{"SUBPRODUCTO":"ETIQUETA","CODIGO":"EP-0188 02","STOCK":"1264749"},{"SUBPRODUCTO":"ETIQUETA","CODIGO":"EP-0423","STOCK":"1264731"},{"SUBPRODUCTO":"ACUSE DE RECIBO","CODIGO":"EP-0006","STOCK":"941928"},{"SUBPRODUCTO":"BOLSA SEGURISELLO","CODIGO":"TS-4290-1","STOCK":"851459"},{"SUBPRODUCTO":"FLYER","CODIGO":"EP-0425","STOCK":"115904"}]
...so my aggregation is getting results.
However, the widget report is showing as the attached image, which is clearly not correct.
I attach too the configuration of my widget array, which is including only the columns I want to see, that is, all the columns I wrote in the $project pipeline.
Please, note that the number of elements shown in the report in the attached image is 13, which is exactly the number of records that the query returns, so I think this could be a visualization error (I'm using Chrome).
Is there a bug in the widget report? Am I doing something wrong with the widget?
Kindly regards
--
Fujitsu - RunMyProcess
---
You received this message because you are subscribed to the Google Groups "Fujitsu RunMyProcess Developer Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to supportforum+unsubscribe@runmyprocess.com.
To post to this group, send email to suppor...@runmyprocess.com.
Visit this group at https://groups.google.com/a/runmyprocess.com/group/supportforum/.
To view this discussion on the web visit https://groups.google.com/a/runmyprocess.com/d/msgid/supportforum/af330b1a-e932-43ff-9c82-c0654d21c09a%40runmyprocess.com.
For more options, visit https://groups.google.com/a/runmyprocess.com/d/optout.