I have the following Python code:
from pymongo import MongoClient
db = MongoClient("mongodb://localhost/")["admin"]
collection = db["collection_test"]
collection.insert_one({"key1": 1000000000.1, "key2": 1.1})
doc = collection.find_one()
print(type(doc["key1"]))
print(type(doc["key2"]))
Which prints:
<class 'float'>
<class 'float'>
But based on the docs I expected the types to be
<class 'bson.decimal128.Decimal128'>
followed by something like 'bson.double'.
Why aren't I seeing a BSON Decimal128 and a BSON Double? Is type() not the correct way to get the types in this context?