Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

tMongoDBRow component - aggregation

I would like to ask you if you you have found a similar problem than us and what workaround the best possible approach.

 

We are using MongoDB Atlas version 4.0, and it does not support eval function (not supported for MongoDB ATLAS M10 clusters).

We need to insert aggregated data from a MongoDB collection called "tableHist" to a collection called "table", in an ELT scenario so MongoDB aggregates and inserts data.


We are considering the usage of tMongoDBRow component, through "Execute command" option, but we are stucked with the query that Talend expects. Please, see the original MongoDB query below:
db.tableHist.aggregate([
{$sort: { "npol": -1, "datostable.fechas.fechaPrimerEfecto": -1}},
{$group: {
_id:"$npol",
"doc":{"$first":"$$ROOT"}
}
},
{"$replaceRoot":{"newRoot":"$doc"}}
],{allowDiskUse:true})

 

We have tried:
"db.table.insert(db.tableHist.aggregate([{$sort: { 'npol': -1, 'datostable.fechas.fechaPrimerEfecto': -1}}, {$group: { _id:'$npol', 'doc':{'$first':'$$ROOT'}}}, {'$replaceRoot':{'newRoot':'$doc'}}],{allowDiskUse:true}));"

 

Thank you in advanced.

Labels (4)
0 Replies