[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 Created: 18/Apr/18  Updated: 27/Mar/19  Resolved: 27/Mar/19

Status: Closed
Project: Compass
Component/s: Compass, Import/Export
Affects Version/s: 1.12.6
Fix Version/s: None

Type: New Feature Priority: Major - P3
Reporter: Brian Blevins Assignee: Unassigned
Resolution: Won't Fix Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File Insert_after_JSON_dragdrop.png     PNG File Original_doc_before_copydocument.png    
Issue Links:
Related
is related to COMPASS-2767 Add the ability to Copy/Paste a docum... Closed
Sprint: Iteration Bison

 Description   

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.



 Comments   
Comment by Massimiliano Marcon [ 27/Mar/19 ]

This wasn't even an official feature. Code was removed.

Generated at Wed Feb 07 22:30:56 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.