In python, you can use simplejson encoder to convert bson to json as follows:
result = db.mycol.find({ ....}) json = simplejson.dumps(result)
It converts all simple objects, but will have difficulties with others, for example, datetime will not work. The following may work to solve this problem: MongoDB object Serialized as JSON
source share