MongoDB Reader/Writer

Licensing options for this format begin with FME Professional Edition.

Overview

FME provides read and write access to MongoDB databases. MongoDB databases contain collections. FME treats these collections as feature types, and can read features from them, as well as write features to them. FME treats each document in the collection as a feature, and each field in a document as an attribute.

MongoDB is a schema-less, document-oriented, NoSQL database that supports GeoJSON geometry. The MongoDB server and tools are open source, so users can either make use of a MongoDB web platform, or they can deploy their own instance of the software.

More information about the MongoDB can be found at www.mongodb.com.

Format Usage Notes

  • MongoDB documents may contain nested documents. For the Reader, the fields in nested documents are represented as attributes with a “.” in the name, in the form of: “<nested_document_name>.<nested_document_field>”. The Writer treats these attributes the same way. If an attribute name contains a “.”, then it will be written as a nested field.
  • Reader: MongoDB is schema-less, so the reader uses the fields from the first batch of features to establish a schema. This batch size (“Num Features Per Request”) is configurable.
  • Writer: MongoDB uses a fixed coordinate system: LL-WGS84. All features written to a MongoDB collection will be reprojected to LL-WGS84, or assumed to be already in LL-WGS84 if no coordinate system is set.

Reader Overview

The MongoDB reader supports reading multiple collections from the same MongoDB database. Because of this, a separate reader must be created for each MongoDB database.

The collections must be defined in the workspace before they can be read.

Writer Overview

The MongoDB writer stores documents into a collection associated with a MongoDB database. The MongoDB writer provides the following capabilities:

Collection Creation

The MongoDB writer uses the information within the FME workspace to automatically create MongoDB collections as required. Each collection will be created when the first input feature is processed. If no features are sent to a feature type, then the corresponding collection will not be created.

Collection Overwrite

If the Table Handling Format Parameter for a feature type is set to Drop and Create, then the writer will drop and re-create the collection before writing any features to it.

Collections will be overwritten when the first input feature is processed. If no features are sent to a feature type, then the corresponding collection will not be overwritten.

FME Community

Search MongoDB