MongoDB Extract

This extract type can query data from the document-oriented database MongoDB and from Azure Cosmos database services with model/API for MongoDB.

Settings

Connection Connection of type MongoDB.
Collection A collection is a group of related documents that have a set of shared common indexes. They are similar to tables in relational databases.
Find query The filter criteria on the collection. It is equivalent to the db.collection.find() method in the Mongo shell. For details on the syntax see https://docs.mongodb.org/manual/tutorial/query-documents/

Example:
{ type: "snacks" }
retrieves all documents where the type field has the value snacks.

JSON path An JSONPath expression that defines the root or anchor element of the JSON document under which the data are read. To retrieve from the top of the document, the JSONPath is "$".
Export data fields The output columns of the extract are defined by JSONPath expressions. For each column, a name and a default value can be defined. All space, multiple space, or null-values will be mapped to this default value.

Note: JSONPath is a standard query language for selecting nodes from an JSON document. You can find more information on JSONPath at http://goessner.net/articles/JsonPath/

Sort method (optional) Specifies the order in which the query returns matching documents.

Example:
{ age : -1, posts: 1 }
A descending sort by the age field and then an ascending sort by the posts field.

For details on the syntax: https://docs.mongodb.org/manual/reference/method/cursor.sort/

Projection method (optional) A projection that specifies the fields from the matching documents to return. This parameter does not change the result of the extract, as the fields are already specified in "Export data fields". However, it may influence performance or memory consumption with large quantities of data.
Log result If checked, the resulting documents are logged in Info Messages.
Use caching Memory, disk, or none (default). See Caching in Extracts for more information.

Updated April 14, 2025