I have the following piece of code in python which is trying to pass a mongo query. Details of the connection are below. When I execute this, I get "invalid syntax" and the syntax error points right after the code "total:{"... I think this has something to do with dictionary objects in Python but I am a little confused how to proceed.
import pymongo
from pymongo import MongoClient
client = MongoClient()
db = client.trackers
a = list((db.monthlytracker.aggregate([{$match:
{'Country':'Japan','Vendor':'Others'}},
{$group:{_id:"$Fiscal Quarter",total:{$sum:"$Units"}}}])))