MongoDB Collection Source Example 1. Example Data
The following is an example of data we want to sync out of MongoDB.
Copy 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:
1.1 XML Example
Copy < 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=""{ "Price": { "$lt": 10 } }"" projection=""{
"Name": 1,
"Price": 1,
"Color": "Details.Color",
"Size": "Details.Size",
"Stock": 1,
"Details": 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 >