Read mongoDB request

Six Stars

Read mongoDB request


i want to read mongoDB request but it don't work, i have errors.

The mongoDB request is aggregate type and complex :


{"$match" :{billrun:"201707", type:"flat"}},
{"$group" :{
"_id":{"billrun" : "$billrun", "compte" : "$aid", "service" :"$sid"},
"compte": {"$max":"$aid"},
"totalAmount":{"$sum":"$aprice"} }},
{$project :{_id:1, "facture":'$billrun', "compte":'$compte', "service":"$service","totalAmount":'$totalAmount'}}]).map(function(doc){
return( doc.facture + ";" + doc.compte + ";" + doc.service + ";" + doc.totalAmount );

the request, in RoboMongo, returns a result like this : 



job is easy : tMongoDBConnection(it work) ---> tMongoDBInput(error) ---> tLogRow

For surrond strings with single quotes, how can i write whitout error my request ? I tried this : but it dont work.


The request in "Aggregation Stages tab" line is :

"{'$match' :{billrun:'201707', type:'flat'}},{'$group' :{'_id':{'billrun' : '$billrun', 'compte' : '$aid', 'service' :'$sid'},'billrun':{'$max':'$billrun'},'compte': {'$max':'$aid'},'service':{'$max':'$sid'},'totalAmount':'$sum':'$aprice'} }},{$project :{_id:1, 'facture':'$billrun', 'compte':'$compte', 'service':'$service','totalAmount':'$totalAmount'}}"

I have "Index cannot be resolved", "syntax error on tokens, delete these tokens"


schema of tMongoDbInput component is : 

facture (dBColumn : facture) (string)

compte (dBColumn :compte) (string)

service (dBColumn :service) (string)

totalAmount(dBColumn :totalAmount) (string)







Re: Read mongoDB request


Could you please post your component setting screenshots on forum which will be helpful for us to address your issue.

Please mask your sensitive data.

Best regards


Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Six Stars

Re: Read mongoDB request




a screenshoot Smiley Happy