-
Type:
Task
-
Resolution: Won't Fix
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Methods that accept/return BSON documents are currently annotated with Mapping[str, Any]. Ideally we could list the acceptable BSON value types to improve type safety. For example we could define the BSON value types:
BsonType = Union[str, int, ObjectId, datatime, Timestamp, Decimal128, etc..., Mapping[str, 'BsonType'], List['BsonType']] Mapping[str, BsonType]
Even if we list the BSON types explicitly, we may still need to include "Any" so that we accept custom types handled by the TypeRegistry.