Hello, I have been developing and testing an application on Windows with mongodb v 5.0, compass V1.30.1, python 3.8.5, pymongo 3.12.0. I have really loved the easy conversion between the database interface to python objects and have developed based on this ease.
I have been attempting to impliment this on an Ubuntu VM, and have run into issues with the projection of datetime objects from BSON response to python objects. On the VM I am runnin python 3.8.0, mongodb V5.0.6, and pymongo V 4.0.1 (I have also tried with V3.12.0 and gotten the same issue).
Example on windows (python):
d = dryers.find({‘active’:True})
for di in d:
print(d)
Returns:
{’_id’: ObjectId(‘61f08e8846ed5d676894977c’),‘deploymentDate’: datetime.datetime(2022, 1, 25, 22, 15)}
Running same script on VM, I get
{’_id’: ObjectId(‘61f08e8846ed5d676894977c’),‘deploymentDate’: {’$date’:’‘2022-01-25T22:15:00.000Z’)}}
I could rewrite the interface portion to get what I want, but curious if there is an obvious fix to make the VM behave like windows here.
Thanks!