-
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 :
- The new document having the same types as the old document
- Compass to notify me that the documents new types are changed to default
- 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.