Multiple Data Types in MongoDB Projects

This feature applies to defining multiple data types for a field in a collection or document. When modeling, you can select the Any data type. The name of this data type is specific to Moon Modeler. It is short enough that it is reasonable to display it in the ER diagram.

Of course, it also allows you to define what data types can be written in this field, such as string and double.

How to specify multiple data types?

Just pick the Any data type from the dropdown and define value in the Any restriction input field.

mongodb multiple data types

Note: This data type is also displayed when you connect to a MongoDB database and visualize the existing database structure. If structure detection using data is set in the connection and the data is not unambiguous, the Any data type is used for visualization.


If you do not specify a value for the Any restriction, a listing of all data types is displayed in the generated validation script.

mongodb mulitple data types - all

Quick links

Free Trial Buy Now!

Blog Categories
Blog by Platforms