Forming Aggregation pipeline using mongo-c-driver API's

How to form the complex aggregation pipeline using MongoC driver API. I know BCON_NEW can be used to form the hard-coded pipeline but If we want to form pipeline run time. What are the various ways available? Can you provide some complex example.
E.g. If I want to build below aggregation pipeline:

db.t5.aggregate([ {$lookup: { 
				from: "t6",
				let: {id_field: "$id", age_field: "$age", name_field: "$name"},
				pipeline: [ { $match:{ $expr:{ 
							   $and: [
							        { $or: [
							              { $eq: [ "$old", "$$age_field" ] },
							              { $eq: [ "$no", "$$id_field"] }
								  ,{ $eq: ["$alias", "$$name_field"] }
				as: "joined_result"
		   {$unwind: {path: "$joined_result", preserveNullAndEmptyArrays: false}}

Please note that below is equivalent query in SQL:

LEFT JOIN t6 ON (t5.age = t6.old AND = OR = t6.alias);

Where t5 and t6 are collections/tables and t5 has age, id and name columns/fields. Also, t6 has old, no and alias columns/fields.

What are possible ways to build this pipeline run time using MongoC driver API’s. The meaning of ‘run-time’ is that there can be different operations I mean multiple Join clauses. Different AND and OR combinations.

Is there any tool to build pipeline?

Hi @Roberto_Sanchez @Shane @Paul_Done @Kevin_Albertson @tapiocaPENGUIN Could you please comment on this ? Otherwise please ask someone who is good at C driver.

Let me know if problem description is not clear or you need more details.

It would be great help. Thanks.