Advanced Copy and Paste in Moon Modeler

In Moon Modeler you can use the copy and paste function to copy collections as well as individual fields. Let’s take a look at how to work with selected objects and what the paste inside option means.

Selections and copy & paste

Working with collections and individual fields without complex structure is easy. Just use the mouse and the CTRL (Command) key to expand the selection to multiple collections or multiple fields. Then use the keyboard shortcuts CTRL+C and CTRL+V as usual.

However, if you want to work with fields that are of type object (document), you can choose from several options.

Standard copy & paste

In the diagram you can select a field of type object by clicking on this field in the collection, or by clicking on the graphic item representing the object (1). You can then right-click and select Copy (2) from the context menu.

Copy document

Then choose the target collection or object. In the following example, the Vendor collection is selected as the target. Right-click on this object (1) and select Paste (2) from the context menu.

Paste document

After this action, there is a new field Address in the Vendor collection, including the contained objects structure.

The result of copy and paste

Paste inside

Copying larger structures is also easy. Sometimes you may want to paste part of a structure not into the main collection, but into an already defined child object.

In this demonstration, we will start with a simple example. For the Customer collection, we will create a structure that contains a Billing address and also a Delivery address. The delivery address will be created by copying the billing address.

Select the billing address, right-click and select Copy.

Copying fields

Then right-click in the collection area and select Paste from the context menu.

Pasting fields

Then just rename the newly created copy to delivery_address.

The result

The copy we have in the clipboard can also be pasted into an existing field/object. Just select the field/object, right click and select Paste inside from the context menu.

Paste inside

Below you can see the newly inserted field renamed to primary_address.

Final structure

The structure is seemingly complete.

Working with multiple items

Now let’s see how to insert a copy or move multiple items into an existing field/object.
In this part of the demonstration we will look at how to insert the billing address, delivery address and note into the contact field/object.

Select multiple fields from the collection using the mouse and the CTRL (Command) key. Right click on one of them and select Copy.

Copying multiple fields

Then select the target field/object and choose Paste inside from the context menu.

Pasting into a document

The result:

MongoDB database structure

The last step is to delete the original fields that are no longer needed.

Deleting multiple columns

The final database structure:

Final MongoDB schema

#

DATA MODELING TOOLS
DRAW Diagrams and
GENERATE Scripts
Download data modeling tools
Blog Categories
Blog by Platforms