MongoDB Reader/Writer
This version of the FME MongoDB Reader/Writer supports connections to MongoDB servers of version 3.1 and higher.
MongoDB Product and System Requirements
Format |
FME Platform |
Operating System |
||||
---|---|---|---|---|---|---|
Reader/Writer |
FME Form |
FME Flow |
FME Flow Hosted |
Windows 64-bit |
Linux |
Mac |
Reader |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
Writer |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
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 format 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 period (.) 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 period, 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.