v5.0 - v5.5 Data Sync Documentation
  • Overview
  • Release Notes
    • V4.5
    • V4.6
    • v4.7
    • v4.8
    • v4.9
    • v4.10
    • v4.12
    • v4.13
  • v4 Connections Installation Guide
    • v5 Connections and CLI Installation Guide
  • v4 Worker/Listener Installation Guide
    • v5 Worker/Listener Installation Guide
  • Upgrades & Config Changes
  • Builder Guide
    • Overview
    • Types of Data Syncs
    • Subscribing to Event Streams
      • Supported Stream Sources
        • Amazon Simple Queue Service (SQS)
        • Cinchy Change Data Capture
        • Data Polling
        • Kafka Topic
        • MongoDB
        • Salesforce
          • Push Topic
          • Platform Event
    • Configuring a Data Sync
      • Connections Experience & XML Config Reference
        • Info
          • Parameters
            • String Escape
        • Source Config Reference
          • Schema Columns
            • Calculated Column Examples
          • Auth Requests
          • Request Headers
          • Pagination
          • Source Filter
        • Target Destination Config Reference
          • Column Mappings
          • Target Destination Filter
        • Sync Behaviour
        • Post Sync
        • Permissions
        • Jobs
        • Connections Usage Example
      • Data Validation
      • Transformations
        • StringReplacement
      • Supported Data Sources
        • File Based Source
          • Binary File
            • Binary File Data Source Example
          • Delimited File
            • Delimited File Data Source XML Example
          • Fixed Width File
          • Excel
            • Excel Source XML Example
        • Cinchy Event Broker/CDC
          • Cinchy Event Broker/CDC XML Config Example
        • Cinchy Table
          • Cinchy Table XML Config Example
        • Cinchy Query
          • Cinchy Query Data Source Example
        • Copper
        • DB2
        • Dynamics 2015
        • Dynamics
        • DynamoDB
        • Kafka Topic
          • Apache AVRO Data Format
          • Kafka Topic Source Example
        • LDAP
        • MongoDB Collection
          • MongoDB Collection Source XML Example
        • MongoDB Collection (Cinchy Event Triggered)
        • MS SQL Server Query
        • MS SQL Server Table
        • ODBC Table
        • ODBC Query
        • Oracle Table
        • Oracle Query
        • Parquet
        • Polling Event
          • Polling Event Example
        • REST API (Cinchy Event Triggered)
        • REST API
          • REST API XML Example
        • SAP SuccessFactors
        • Salesforce Object (Bulk API)
        • Salesforce Platform Event
        • Salesforce Push Topic
        • Snowflake
          • Snowflake Source XML Example
        • SOAP 1.2 Web Service
      • Supported Sync Targets
        • Cinchy Table
        • DB2 Table
        • Dynamics
        • Kafka Topic
        • MongoDB Collection (Column Based)
        • MS SQL Server Table
        • Oracle Table
        • REST API
        • Salesforce
        • Salesforce Object
        • Snowflake Table
          • Snowflake Table Target XML Example
        • SOAP 1.2 Web Service
    • Common Design Patterns
    • Testing a Data Sync
    • Promoting a Data Sync
    • Scheduling a Data Sync
    • CLI Command List
    • Connections Functions
    • Monitoring
  • Cinchy Platform Documentation
Powered by GitBook
On this page
  • 1. Example Data
  • 2. XML Example
  • 1.1 XML Example

Was this helpful?

  1. Builder Guide
  2. Configuring a Data Sync
  3. Supported Data Sources
  4. MongoDB Collection

MongoDB Collection Source XML Example

An example data sync XML using a MongoDB Collection as a source.

1. Example Data

The following is an example of data we want to sync out of MongoDB.

test> db.Articles.find()
[
  {
    _id: ObjectId("63d812afd755fcdeed234402"),
    Name: 'Shirt',
    Price: 19.95,
    Details: { Color: 'Red', Size: 'Medium' },
    Stock: 12
  },
  {
    _id: ObjectId("63d8137bd755fcdeed234403"),
    Name: 'Shirt',
    Price: 9.95,
    Details: { Color: 'White', Size: 'Small' },
    Stock: 61
  }
]

2. XML Example

This example XML uses the following values:

Value
Description
Example

connectionString

The connections string for your source

"87E4lvPf83gLK8eKapH6Y0YqIFSNbFlq62uN9487"

Database

The name of your MongoDB database

"test"

Collection

"Article"

Type

The method used to retrieve your data.

"find"

Query

A query for retrieving your data.

This example query returns data where the price is less than 10$.

Projection

A projection for flattening your source document.

Column Name

The name(s) of your source column(s)

"id" "name" "price" "colour" "size" "stock" "$" (This is used to retrieve the full document.) "Details" (This is imported both as set of fields (flattened from the projection) and as a JSON.)

dataType

The data type of your source column

"Text" "Text" "Number" "Text" "Text" "Number" "Text" "Text"

isMandatory

Whether the column is mandatory or not

"false"

validateData

Whether the column data needs to be validated or not

"false"

1.1 XML Example

<BatchDataSyncConfig name=""MongoDB Data Source Example"" version=""1.0.0""
    xmlns=""http://www.cinchy.co"">
    <MongoCollectionDataSource connectionString=""AI+FJVIMO1HP/CkZ5yphXeJ01wjH/4ilJ8xAIPPDyxvYq0oiYnVBQrzaq2Cp5942poeDdOp"" database=""test"" collection=""Articles"" type=""find"" query=""{ &quot;Price&quot;: { &quot;$lt&quot;: 10 } }"" projection=""{
    &quot;Name&quot;: 1,
    &quot;Price&quot;: 1,
    &quot;Color&quot;: &quot;Details.Color&quot;,
    &quot;Size&quot;: &quot;Details.Size&quot;,
    &quot;Stock&quot;: 1,
    &quot;Details&quot;: 1
}"">
        <Schema>
            <Column name=""_id"" dataType=""Text"" trimWhitespace=""true"" isMandatory=""false"" validateData=""false""/>
            <Column name=""Name"" dataType=""Text"" trimWhitespace=""true"" isMandatory=""false"" validateData=""false""/>
            <Column name=""Price"" dataType=""Number"" isMandatory=""false"" validateData=""false""/>
            <Column name=""Color"" dataType=""Text"" trimWhitespace=""true"" isMandatory=""false"" validateData=""false""/>
            <Column name=""Size"" dataType=""Text"" trimWhitespace=""true"" isMandatory=""false"" validateData=""false""/>
            <Column name=""Stock"" dataType=""Number"" isMandatory=""false"" validateData=""false""/>
            <Column name=""$"" dataType=""Text"" trimWhitespace=""true"" isMandatory=""false"" validateData=""false""/>
            <Column name=""Details"" dataType=""Text"" trimWhitespace=""true"" isMandatory=""false"" validateData=""false""/>
        </Schema>
    </MongoCollectionDataSource>
PreviousMongoDB CollectionNextMongoDB Collection (Cinchy Event Triggered)

Last updated 2 years ago

Was this helpful?

The name of your

"{ "Price": { "$lt": 10 } }"
"{
    &quot;Name&quot;: 1,
    &quot;Price&quot;: 1,
    &quot;Color&quot;: &quot;Details.Color&quot;,
    &quot;Size&quot;: &quot;Details.Size&quot;,
    &quot;Stock&quot;: 1,
    &quot;Details&quot;: 1
}"
MongoDB collection.