[PyMongo] Empty Response from Aggregation


I’m facing an issue with PyMongo - I’ve built an aggregation pipeline in MongoDB Compass and used the code in a Python program to aggregate the same documents, but in Python the response of the same hard coded aggregation is empty although it fulfills my needs in MongoDB Compass.

Thank you for your help.

You probably have a syntax error on the Python side. The syntax is not exactly the same between Compass JSON and Python.

It will help us to help you if you could post some sample documents and the relevant Python code.

Since this is you first interaction here please consult Formatting code and log snippets in posts before posting code.

1 Like

If you use the export function button in compass you can export as python3, did you do this ?