i have tried the below steps:
-
stored the below pipeline in mongo db
[{"$match": {"_id": var_id, “date”: todaysdate}}] -
retrieved the pipeline from mongo using python and stored in variable as below
pipeline= [($match: var_id), ($match: date: todasdate)]
here pipeline is string.
collection.aggregate(pipeline) // This line throws error as aggregate accepts only list not string.
so i have used json.loads(pipeline)
again now i got error as json expects double quotes for var_id… if i use double quote for var_id , value will not get assigned…
Hope this helps …Please help here