The problem appears to be in the return value. The return value of the insert method is the inserted _id(s)
and acknowledged
. The return type is <class 'pymongo.results.InsertOneResult'>
. I'm not very good at coding, so I'm not sure why it doesn't return, but it does. Try getting the ids back
reference:
https://pymongo.readthedocs.io/en/4.3.3/api/pymongo/results.html
https://stackoverflow.com/questions/8783753/how-to-get-the-object-id-in-pymongo-after-an-insert