I would really appreciate if someone can help me with this. I need Django (Python) function to inject some parameters into a pipeline script, pass it to MongoDB Atlas and receive the result in a cursor.
from bson import ObjectId
import pymongo
conn = "connection string"
client = pymongo.MongoClient(conn)
pipeline = [
<<pipeline script>>
]
out = client.db.mycollection.aggregate(pipeline)