MongoDB ODM Tips


MongoDB ODM uses specific functions compared to most other frameworks. This article lists functions and features specific for MongoDB ODM which can be easily used and managed by Skipper.

Defining namespace

Skipper fully supports namespaces in MongoDB ODM projects. Each bundle in Skipper can have its own namespace. If you want to configure namespace, choose bundle and edit namespace property inside the ODM property editor.

Define MongoDB ODM namespace property in Skipper

Entity file-suffix format

In some cases you will need to change the entity file-suffix while using the same export format. For example to use MongoDB ODM with Symfony2 it is necessary to change exported file names from .dcm.yml to .odm.yml. You can do this manually for each bundle or each entity. The recommended way is to change file name format for the whole bundle:

Define MongoDB ODM definition file suffix for export in Skipper

Entity export path

When importing MongoDB ODM project, Skipper saves relative location of each entity. This means that when you export the model, all files will be created at the exact locations they were before. The export path for each entity is stored in the ODM property export-file-name.

Define MongoDB ODM schema definitions export path in Skipper