In python i am using aggregation for a query and i am using db.runCommand for that . problem is i want to insert the variable collection name instead of its actual name . suppose the collection name is xyz .
collec = 'xyz'
func_(collec)
now in another file i am using
def func_(collection1):
data = db.runCommand('aggregate', 'collection1', pipeline=pipe)
so how to use this collection1 instead of xyz in this db.runCommand