MongoDB Extract

image_pdfimage_print

This extract type can query data from the document-oriented database MongoDB.

Main settings

Connection

Connection of type MongoDB.

Collection

Name of the 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.

JSONPath

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/

Advanced settings

Sort method

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

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

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. (optional)

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.

image_pdfimage_print
Was this post helpful?
NoYes (No Ratings Yet)
Loading...