MongoDB BSON numeric types such as int (NumberInt) and long (NumberLong) are not preserved when editing or saving documents. This results in documents being saved with untyped numeric values (e.g., 5 instead of { "$numberLong": "5" }), which can violate MongoDB schema validation rules that explicitly expect certain bsonType values.
Describe the solution you'd like
Please consider enhancing type handling to:
- Use canonical extended JSON ($numberInt, $numberLong) in raw/JSON editors and exports.
- Preserve BSON type fidelity when reading and writing documents.
This would greatly improve compatibility with MongoDB’s schema validation and reduce unintended type loss during edits.