Articles in this section

Export data from MongoDB

To begin exporting data from MongoDB, choose one of the following options:

Create an export

Attach a new export within a flow

  1. Select Flow Builder from the Tools menu. A blank flow opens with empty source and destination/lookup applications. 
  2. Click Add source. The Create export panel opens. 
  3. For the source Application, select MongoDB.
  4. Next, you’re asked to provide a MongoDB connection. Either select an existing MongoDB connection from the list, or click the + button to establish a new MongoDB connection
  5. Click Next. (Continue with Describe the export.)

Create a standalone export

  1. Select Exports from the Resources menu. A list of all exports in your account opens. 
  2. In the resulting Exports page, click + Create export. The Create export pane opens. 
  3. For the source Application, select MongoDB.
  4. Next, you’re asked to provide a MongoDB connection. Either select an existing MongoDB connection from the list, or click the + button to establish a new MongoDB connection
  5. Click Next.

Describe the export

Name (required): Name your export so that you can easily reference it from other integrator.io resources.

Description (optional): Describe your export so that others can quickly understand what it is doing without having to read through all the fields and settings. Be sure to highlight any nuances that someone should be aware of before using your export in their flows. Also, as you make changes to the export, be sure to update this field.

Collection (required): Enter the name of the MongoDB collection in your database that you will query, such as orders, items, users, or customers.

Filter (optional): To export only specified documents from your collection, enter a filter for this setting. The value must be a valid JSON-formatted string describing a MongoDB filter object – in the correct format and with the correct operators. Refer to MongoDB documentation for the list of valid query operators and the correct filter object syntax. For example:

{"Name":"MongoDBRecord1"}

Warning: When filtering the record based on the _id field, the Id must be written as follows, so integrator.io processes it as a MongoDB Id rather than a string:
{"id":"ObejctId('id')"}

Projection (optional): To return only a subset of fields from each MongoDB document, enter a projection here. The value of this field must be a valid JSON-formatted string describing a MongoDB projection object – in the correct format and with the correct operators (not mixing inclusions and exclusions). Refer to MongoDB documentation for the expected projection object syntax and operators. For example:

{"Name":true}

Select a type 

Four options are available for the Export type setting:

All

Exports all records in the collection each time the export is run. 

Delta

Export all records with a Date field value that is greater than the last time the data flow was run. 

Date field (required): Provide a date field in MongoDB that integrator.io can use to keep track of records that have changed since the last time the export was run. It is recommended that you pick a system-generated field. For example, many applications maintain a standard Date Last Modified or Last Modified Date field that always contains the date and time that a record was last changed. You could select a custom field if you have your own logic in place to set the field accordingly whenever a relevant change is made to a record. 

The MongoDB field must contain a valid date value, such as a BSON date type. A string containing a timestamp will not be interpreted as a date for purposes of comparing changed records for the export. 

Once

Export any records that have not been exported already and automatically update records to mark them as exported.

Boolean field (required): Select a Boolean (checkbox) field in MongoDB that integrator.io can use to keep track of records that have been exported. integrator.io will export only those records where this field is false (unchecked) and then make a subsequent request to MongoDB to set the Boolean field to true for all exported records (so that they are exported once).

Limit

Export a limited set of records, primarily used for testing to avoid syncing lots of data.

Note: When you select the export type as Limit - export a set number of records, another setting How many records would you like to export? is enabled for you to enter the maximum number of records to export each time this flow runs. The default value is set to one. You can export a maximum of 100 records. 

Preview exported data

You can validate your expressions by clicking Preview to view the first record in the results or any errors.

Note: This export preview will show the results for all export types except Delta, in which case you would have to validate any export errors.

Group export records

The Grouping option allows you to manage your flow’s files by grouping records by field. This feature allows you to aggregate your data based on your chosen field(s).

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.