MongoDB Reader Feature Type Parameters

Important  These parameters apply only to a selected feature type, not to the entire writer. If a feature type parameter listed here conflicts with a writer-level parameter, then the writer parameter will be ignored and this feature type parameter will be used.

Collection

JSON Query

This parameter specifies a JSON document that will be used to filter input features. The JSON document should be formatted as if calling the method db.collection.find() in the MongoDB shell. See the MongoDB documentation.

Examples

To filter features where the attribute foo has the value bar, the JSON Query should be:

{ “foo”: “bar” }

String Match

Find all the cities that are in the province of British Columbia:

{"Province_Name": "British Columbia" }

AND Example

The following query will find cities that are capitals and have a population of 100K and above:

{"Capital" : "YES", "Population":{ "$gt": 100000}}}

Note  Date types with integers and numbers do not require quotes.

ISO Date

To work with “DATE” queries in FME, the syntax has to be in the following format. The following query will read data that has “PublishDate” greater than or equal to the date mentioned in the query:

{"PublishDate" : { "$gte" :{"$date": "2016-03-10T00:00:00.000Z"}}}