Document data type
The Document data type is modeled after BSON. Documents are quite flexible, and complex hierarchies are supported. There are are few caveats:
MongoDB limits nesting depth to 100.
Each document is limited to a size of 16MB in its serialized form.
Data Management automatically converts Document fields to and from JSON Unicode strings. While this mostly follows the JSON conventions, the BSON types that are not directly supported in JSON are rendered as JSON sub-documents (as described in the MongoDB documentation).
Data Management data type | Example | JSON representation | Notes |
---|---|---|---|
|
|
| N/A |
|
|
| N/A |
|
|
| N/A |
|
|
| N/A |
|
|
| Base64 encoding. |
|
| N/A | No natural representation, but Data Management tools can convert to/from string. |
|
| N/A | No natural representation, but Data Management tools can convert to/from string. |
| N/A | N/A | N/A |
| N/A |
| Data Management will convert an |
Document fields are directly read from and written to the DLD file format and the MongoDB connector tools.
Document type conversions
An implicit conversion is one where a field of type Document is assigned to a field of another type, or vice-versa. This usually occurs in the context of the Calculate tool. Data Management supports the following implicit conversions:
Unicode>Document: The Unicode string is assumed to contain the JSON representation of a BSON document, and is parsed.
TextVar>Document: The same as Unicode>Document, but not all code points can be represented.
Document>Unicode: The Document is formatted as a JSON representation of the BSON document.
Document>TextVar: The Document is converted to Unicode, and than to TextVar. May result in replacement of some code points with
?
characters.Binary>Document: The Binary data is assumed to contain a UTF-8 encoded string. The Binary data is decoded into a string and then converted as per Unicode>Document.
Document>Binary: The Document data is formatted into Unicode as per the Document>Unicode conversion, and then the Unicode string is encoded using UTF-8 into bytes.
Explicit conversions can be performed using the Change Field Types tool. Data Management supports the same set of conversions as in implicit conversions.
An invalid conversion (either because of invalid source data, or because the type conversion is not supported) will result in the target field getting an <<ERROR>>
value.