[TROUBLESHOOTING] motor - 'InsertOneResult' object is not iterable

THOVY·2023년 5월 5일
0

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://motor.readthedocs.io/en/stable/api-tornado/motor_collection.html?highlight=insert#motor.motor_tornado.MotorCollection.insert_one

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

https://stackoverflow.com/questions/73858220/why-am-i-receiving-the-following-error-while-inserting-data-into-the-mongodb/76180136#76180136

profile
BEAT A SHOTGUN

0개의 댓글