Compass changes all double types in a file if possible on document replace without notifying the user

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Environment:
      OS:
      Windows 10
      Additional info:
      Mongo v.8.0
      MongoDB Compass v.1.44.4
    • 3
    • Iteration Neptune, Iteration Ozone
    • None
    • None
    • Developer Tools

      Problem Statement/Rationale

      Using Compass you can edit the values inside a document in multiple ways. When viewing the document in JSON format, after updateing the document you can "REPLACE" the old document with the newly updated one. When vewing the document in the table view or in normal view (print screesn provided later) you can "UPDATE" the existing document.

      If an existing document with fields that have integer values but are of type "Double" is viewed in JSON format and later updated and replaced, all fields that hold integer values and are of type "Double" will be replaced by fields with the correct value but that are of type "Int32".

      I assume this is a feature, as mongo will require less space to maintain these values, but the user is not notified that the new document has changed types. An additional step is required for the user to check the types after replacing the doc to notice this.

      Is there a way to warn the user before replacing a document of this behaviour / notify him that this change has happened ? 

      Steps to Reproduce

      Context:  You need to have a collection that has at least 1 document, with at least 1 field that has as type "Double" but that has an integer value.

      Step 1: Using Compass select this specific document with the "Double" field and integer value. You should view the document in JSON format 

      Step 2:  Update one of the values in the document.  Let's say tha RandomField1 value is updated from 5 to 6

      Step 3: Check again the types of the fields in  the new document 

      Expected Results

      I expected to happen 1 of the following 3 things :

      1. The new document having the same types as the old document
      2. Compass to notify me that the documents new types are changed to default
      3. Compass to warn me that the types will be changed 

      Actual Results

      Compass replaces the document, the new document has Int32 types. No notifications / warnings sent 

      Additional Notes

      I am not a veteran mongo user, and i read that mongo is supposed to hold integer values as Int32 (at least this is what the node driver for mongo automatically does), probably as a space saving feature, but my issue is that you are not warned / notified about this changes.

        1. image-2024-10-02-08-25-44-759.png
          image-2024-10-02-08-25-44-759.png
          25 kB
        2. image-2024-10-02-08-27-30-032.png
          image-2024-10-02-08-27-30-032.png
          25 kB
        3. image-2024-10-02-08-29-31-486.png
          image-2024-10-02-08-29-31-486.png
          22 kB
        4. image-2024-10-02-08-30-48-035.png
          image-2024-10-02-08-30-48-035.png
          22 kB
        5. image-2024-10-02-08-31-32-657.png
          image-2024-10-02-08-31-32-657.png
          25 kB
        6. Screenshot 2024-10-14 at 17.06.14.png
          Screenshot 2024-10-14 at 17.06.14.png
          261 kB

            Assignee:
            Unassigned
            Reporter:
            Victor Pop
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: