-
Type: Task
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
When a user accidentally/incorrectly attempts to insert a single document using insert_many as follows:
client.database.collection.insert_many({'_id': 1, 'data': 'foo})
PyMongo returns the following error message:
TypeError: document must be an instance of dict, bson.son.SON, bson.raw_bson.RawBSONDocument, or a type that inherits from collections.MutableMapping
We should consider making the error message easier to understand in this situation by augmenting the validation we perform here to check that the user has not passed an instance of abc.MutableMapping
- duplicates
-
PYTHON-1690 Fix error message when insert_many is given a single document instead of a list
- Closed