Uploaded image for project: 'Compass '
  1. Compass
  2. COMPASS-3473

When inserting a document, changing field from Object to int32 generates an error

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: 1.16.4
    • Component/s: None
    • None
    • Environment:
      Mac OS 10.14.3

      Creating a new document and adding an empty field with type "Object" then trying to change it to an int32 generates an error "Insert not permitted while document contains error". It looks as though Compass is adding the string value "int32" is added to the field, and so the value is not valid for an int32 data type.

      Work around: Change the field type to string, insert an integer value and then change to type int32. You can now save the document.

      To reproduce:

      • Insert a new document into a collection.
      • Create a new field , e.g. "a" and select type as "Object", do not insert any value.
      • Change the field type to "int32".
      • Error is generated.

      Screen grab of issue: https://cl.ly/7031932a2a81/Screen%252520Recording%2525202019-02-28%252520at%25252014.38.gif

            Assignee:
            Unassigned Unassigned
            Reporter:
            jonathan.fanti@mongodb.com Jonathan Fanti
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: