Using Collection View

For MongoDB, Collection View replaces Database View and Table View. From Collection View, you can view the fields in a selected collection. You can then assign a collection mode to the collection, and assign generators to fields.

Selecting the collection to view

From the Collection dropdown list, select the collection to view.

Assigning a collection mode to the collection

The collection mode is the term used in MongoDB for table mode. The collection mode determines at the collection level how the data for the collection is used to generate the destination database.

By default, the collection mode is De-Identify. In this mode, Structural uses the assigned generators to transform the source database into the destination database.

For MongoDB, the only other options are Truncate and Preserve Destination. Truncate means that only the collection structure is included in the destination database. The collection has no data in the destination database. Preserve Destination means that Tonic does not change the data that is currently in the destination database.

To assign the collection mode:

  1. Click the Collection Mode dropdown list.

  2. On the panel, click the current collection mode.

  3. From the drop-down list, select the mode to use.

Selecting the type of view

You can view a collection either as a hybrid document or as single documents. From the View dropdown list, select the view to use.

The default view is Hybrid Document. For the hybrid document view, the key list reflects all of the permutations of every field from every document. For example, a field might sometimes be a datetime value and sometimes a string. Hybrid document view lists both types.

Single Document view displays a single document at a time. You can then page through up to 100 documents. For each document, you see the structure for that particular document.

Information on the field list

For each field, Collection View always displays:

  • The field name and type.

  • For fields that you configured as primary or foreign keys, a key icon.

  • The assigned generator.

  • An example value. For the hybrid view, you can use the magnifying glass icon to display additional example values.

For the hybrid document view, there is also a Field Freq column. Field Freq shows the percentage of documents that contain that permutation of field and type. For example, you might see that a field is Null 33% of the time and contains a numeric value 67% of the time. Or a field value is an Int32 value 3% of the time and an Int64 value 6% of the time. The percentages apply to the first 100 documents.

Toggling between source and preview data

The Preview toggle at the top right of Collection View allows you to choose whether to display original source data or the transformed data. You can switch back and forth to see exactly how Tonic Structural transforms the data based on the collection and field configuration.

By default, the Preview toggle is in the on position, and the displayed data reflects the selected collection mode and the assigned generators. For collections that use Truncate mode, the preview data is empty. Truncated collections do not have data in the destination database.

To display the original source data, toggle Preview to the off position.

Commenting on fields

The commenting feature requires an Enterprise tier license.

You can add comments to fields. For example, you might use a comment to explain why you selected a particular generator or marked a field as sensitive or not sensitive.

If a field does not have any comments, then to add a comment:

  1. Click the comment icon.

  2. In the comment field, type the comment text.

  3. Click Comment.

When a field has existing comments, the comment icon is green. To add comments:

  1. Click the comment icon. The comments panel shows the previous comments. Each comment includes the comment user and timestamp.

  2. In the comment field, type the comment text.

  3. Click Reply.

Indicating whether a field is sensitive

On the field configuration panel, the sensitivity toggle at the top right indicates whether the field is marked as sensitive.

To mark a field as sensitive, toggle the setting to the Sensitive position.

To mark a field as not sensitive, toggle the setting to the Not Sensitive position.

Assigning a generator to a field and type

You can assign a generator to each combination of field and type. For example, depending on the document, the data type for a field might be either string or integer. You can indicate to use the Character Scramble generator when the field type is a string and the Random Integer generator when the field type is integer.

In hybrid document view, the Null type reflects when the column value is Null. You do not assign a generator to it.

To assign a generator:

  1. Click the generator value for the field.

  2. On the configuration panel, from the Generator Type dropdown list, select the generator.

  3. Configure the generator options. For details about the available configuration options for each generator, go to the Generator reference.

Disabling examples for sparse collections

By default, Structural retrieves 100 documents. It then uses the data in these documents to populate example values in the hybrid document.

For sparsely populated collections, where less common fields are not present in those 100 documents, Structural retrieves extra documents until it has example values for all fields. For very sparsely populated collections, this might cause the collection view to load slowly, because it must retrieve many documents.

To disable examples for sparse collections, set the environment setting TONIC_MONGO_DISABLE_EXTRA_EXAMPLES to true. You can add this setting manually to the Environment Settings list on Tonic Settings.

When this setting is true, fields that do not have a retrieved value use a dummy default value that is based on the data type.

Last updated