tMongoDBRow

One Star

tMongoDBRow

Hi all,
I've been scratching my head on this one;
How do I get the output of the command I run in tMongoDBRow for use in the next component?
Here's what needs to be done:
I get a list of (qualifying) entries from MongoDB via the tMongoDBInput, I use the "Name" column from the results to do a fts search via the tMongoDBRow component, for example:
Function: "db.compds.runCommand('text', {search: '" + row1.Name + "', filter: {'ClassId':'SOFTWARESERVER'}, project: {ReconId: 1}})"
Then, I would ideally have a tExtractJSONFileds component to extract the "score" and "ReconId" from the ^resultset for further decisioning and processing.
Any solution to accomplish this would be appreciated, it doesn't have to be the tMongoDBRow component.
Regards and happy holidays,
Johan.
Community Manager

Re: tMongoDBRow

Hi Johan
When I look into the generated code of tMongoDBRow component, I see that this component do not assign command result to a schema column, except printing the result on the console.
		com.mongodb.CommandResult result_tMongoDBRow_1 = null;
result_tMongoDBRow_1 = db_tMongoDBRow_1
.doEval("function(name,age){ return db.person.save({name:name,age:age});}",
row1.name, row1.age);
if (result_tMongoDBRow_1.ok()) {
System.out.println(result_tMongoDBRow_1);
} else {
System.err.println(result_tMongoDBRow_1);
}

So, you can't use tMongoDBRow to search records from MongoDB now.
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: tMongoDBRow