Mongomat

Mongomat is the best place to manage mongodb data. The query builder ui and the completely customizable detail editor are the highlights of mongomat.

The main application is split into different views. The views can be switched in the drop-down-list in the top toolbar. The list will start with the following items:


  • documentation calls up this document
  • settings calls up the collection metadata, which holds all the customization
  • db calls up the list of configured databases
  • schema calls up the list of schemas and 
The entries following the schema view will be the configured databases. These open up submenus with links to all collections' views.

Select a database and a collection from the view selector in the top toolbar. The view changes and provides a grid on the left and a detail editor on the right. 



Toolbar

In the top toolbar there is the view selector and three more buttons:

  • add for adding a new document 
  • settings for opening the settings view
  • help for displaying a help tooltip

Grid

The grid provides a json editor to create a customer query. Also it provides a query builder which opens when clicking on the filter icon on the top left of the grid. Clicking on the column header sorts the data by the columns values. The context menu on the rows provide two actions:

  • open as json opens the document in a pure json editor.
  • delete opens a confirmation dialog and will delete the document.

Detail editor

The detail editor provides a number of self-explanatory actions on the bottom:

  • save
  • discard
  • delete
  • close
On the top there can be a selector which shows the schema of the document and can be used to switch to a different type. The selector shows up only if the collection was configured to have more than one schema in the settings view.


The settings view is accessed from the view selector or by clicking on settings in a collection view. The settings view contains metadata for the collections. This metadata is stored in a special mongodb database. The settings view is just like a collection view for the collection metadata with extra functionality.

The detail editor provides the following properties in the top pane:

  • name the name of the collection as used in the view selector 
  • collection the monogdb collection name.
  • db the database that contains the collection.
  • allow user assigned id? check this if you want the user to provide the mongodb id.
  • description is displayed in the help tooltip in the collection view.
  • schema defines the schema or schemas that documents in the collection conform to.


Schema

A collection can have one or more schemas associated with it. The purpose of the schema is to guide the user in editing documents by providing a sophisticated detail editor. Either there is a single schema for all documents in the collection or each document contains a property that serves as type discriminator - called type property. Schemas are stored separately and it is possible to compose schemas by reference, so that even a recursive schema structure representing a tree model is possible.

The following operations are available:
  • add creates a new collection (toolbar)
  • delete collection and its metadata
  • go to view jump to the data view of the selected collection
  • generate schema information by sampling existing data


Generating the schema 

Generating the schema is a very useful feature if there is an existing collection containing documents. The generation dialog asks the user to specify the number of documents to sample and optionally the name of the type property. Restricting the number of samples will yield a faster generation process but may produce a less exact result. The type property maybe specified if one exists. A type property is a property whose value is interpreted as a type discriminator. There will be a distinct schema for each value of the property. If the documents in the collection were created by a Mapping library in a statically typed OO-language (e.g. Morphia or spring data for Java) then the name of the class will most likely be stored in the type property.

Once you generated the schema you still want to customize it.


Customizing schema and editor

The schema contains information about the editor which the author uses to create and edit documents:

  • the order of the attributes
  • descriptions for each attribute
  • attributes can be grouped in columns, tab or accordions
  • attributes can be made visible, disabled

The list of dbs provides information about their size on disk. The details include the list of collections.
The operations available on a single db include the creation of a new collection and the synchronization between
the actual db's collections and the collections stored in the metadata store. When starting the app these two will be synchronized automatically. If a new collection is created in the db while this app is running then this new collection will not be displayed until a synchronization is performed. A db cannot be created in mongomat right now.