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

As a Compass user I need the "copy document" operation to preserve datatypes when using drag/drop to load documents into a different collection

    • Type: Icon: New Feature New Feature
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 1.12.6
    • Component/s: Compass, Import/Export
    • None
    • Iteration Bison

      When using the copy document button on the Documents tab, the JSON copied to the clipboard is not sufficient to preserve data types such as date, binary, code, decimal128, int64, maxkey, minkey, objectId, bsonRegex, symbol and timestamp.

      The attached screenshot shows the insert document dialog when attempting to drag/drop a JSON document with these types into a collection. Most of the types are converted to strings, however, a few are incorrectly categorized as objects (including code, decimal128, maxkey, minkey).

      This is the original document containing fields with various values.

      The copy document button generates a JSON document on one line. Here is the example spread out for clarity.

      {
      "_id":"5ad749af86c98d53d48d55ab",
      "stringType":"test copy document types",
      "arrayType":["cell one","cell two","cell three"],
      "binaryType":"W29iamVjdCBPYmplY3Rd",
      "booleanType":false,
      "codeType":{"scope":{},"code":"[object Object]"},
      "dateType":"2018-02-11T09:45:54.000Z",
      "decimal128Type":{"$numberDecimal":"986521.44"},
      "doubleType":"3.14159",
      "int32Type":1024,
      "int64Type":"2048",
      "maxkeyType":{"_bsontype":"MaxKey"},
      "minkeyType":{"_bsontype":"MinKey"},
      "nullType":null,
      "objectType":{"subDocField":"stuff"},
      "objectIdType":"5ad74b6d86c98d53d48d55ac",
      "bsonRegexExpType":{"_bsontype":"BSONRegExp","pattern":"[abc].*[xyz]","options":""},
      "symbolType":"alpha-particle",
      "timestampType":"0"
      }
      

      This is the document insertion dialog showing many field types incorrectly detected during drag/drop of the JSON file.

        1. Insert_after_JSON_dragdrop.png
          201 kB
          Brian Blevins
        2. Original_doc_before_copydocument.png
          153 kB
          Brian Blevins

            Assignee:
            Unassigned Unassigned
            Reporter:
            brian.blevins@mongodb.com Brian Blevins
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: