If you read correctly
you will see that the return type of insert_many is of type pymongo.results.InsertManyResult which has the attributes:
- acknowledged
Is this the result of an acknowledged write operation?
The
acknowledgedattribute will beFalsewhen usingWriteConcern(w=0), otherwiseTrue.
and
- inserted_ids
A list of _ids of the inserted documents, in the order provided.
There is no attribute named inserted_count, hence the error
The attribute inserted_count is only present in pymongo.results.BulkWriteResult.