Skip to content

FEAT: MongoDB BSON Numeric Types Not Preserved (Causes Schema Validation Failures) #1154

@Belly-Buster

Description

@Belly-Buster

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions