Document |
{
"_id" : ObjectId("5716054bee6e764c94fa7ddd"),
"name" : "MongoDB extractor",
"revisions" : [
{
"id" : "1c6262e",
"desc" : "First version"
},
{
"id" : "68fc980",
"desc" : "Second version"
}
],
"status" : {
"isActive" : 1,
"isDeleted" : 0
}
}
|
Document in Strict Mode |
{
"_id": {
"$oid" : "5716054bee6e764c94fa7ddd"
},
"name": "MongoDB extractor",
"revisions": [
{
"id": "1c6262e",
"desc": "First version"
},
{
"id": "68fc980",
"desc": "Second version"
}
],
"status": {
"isActive": 1,
"isDeleted": 0
}
}
|
Mapping |
{
"_id.$oid": {
"type": "column",
"mapping": {
"destination": "id",
"primaryKey": true
}
},
"name": "name",
"status.isActive": "isActive",
"status.isDeleted": "isDeleted",
"revisions": {
"type": "table",
"destination": "extractors-revisions",
"tableMapping": {
"id": "id",
"desc": "desc"
}
}
}
|
Output |
extractors
id (marked as PK) | name | isActive | isDeleted |
5716054bee6e764c94fa7ddd | MongoDB extractor | 1 | 0 |
extractors-revisions
id | desc | extractors_pk |
1c6262e | First version | 5716054bee6e764c94fa7ddd |
68fc980 | Second version | 5716054bee6e764c94fa7ddd |
As you can see, joining these two tables will be very easy.
|
Document |
{
"_id" : ObjectId("5716054bee6e764c94fa7ddd"),
"name" : "MongoDB extractor",
"revisions" : [
{
"id" : "1c6262e",
"desc" : "First version"
},
{
"id" : "68fc980",
"desc" : "Second version"
}
],
"status" : {
"isActive" : 1,
"isDeleted" : 0
}
}
|
Document in Strict Mode |
{
"_id": {
"$oid" : "5716054bee6e764c94fa7ddd"
},
"name": "MongoDB extractor",
"revisions": [
{
"id": "1c6262e",
"desc": "First version"
},
{
"id": "68fc980",
"desc": "Second version"
}
],
"status": {
"isActive": 1,
"isDeleted": 0
}
}
|
Mapping |
{
"_id.$oid": {
"type": "column",
"mapping": {
"destination": "id",
"primaryKey": true
}
},
"name": "name",
"status.isActive": "isActive",
"status.isDeleted": "isDeleted",
"revisions.0.desc": "revision0",
"revisions.1.desc": "revision1"
}
The numbers after the "revision" array define the position of the object in the array. 0 is the first position.
|
Output |
extractors
id (marked as PK) | name | isActive | isDeleted | revision0 | revision1 |
5716054bee6e764c94fa7ddd | MongoDB extractor | 1 | 0 | First version | Second version |
As you can see, the values from the "revisions" array are stored in the columns of the "extractors" table.
|
Document |
{
"_id" : ObjectId("5716054bee6e764c94fa7ddd"),
"name" : "MongoDB extractor",
"tags" : [
"keboola",
"extractor",
"mongodb"
]
}
|
Document in Strict Mode |
{
"_id": {
"$oid" : "5716054bee6e764c94fa7ddd"
},
"name": "MongoDB extractor",
"tags": [
"keboola", "extractor", "mongodb"
]
}
|
Mapping |
{
"_id.$oid": {
"type": "column",
"mapping": {
"destination": "id",
"primaryKey": true
}
},
"name": "name",
"tags": {
"type": "table",
"destination": "extractors-tags",
"tableMapping": {
".": {
"mapping": {
"destination": "tag"
}
}
}
}
}
|
Output |
extractors
id (marked as PK) | name |
5716054bee6e764c94fa7ddd | MongoDB extractor |
extractors-tags
tag | extractors_pk |
keboola | 5716054bee6e764c94fa7ddd |
extractor | 5716054bee6e764c94fa7ddd |
mongodb | 5716054bee6e764c94fa7ddd |
|
Documents |
[
{
"_id" : ObjectId("764c94fa7ddd5716054bee6e"),
"name" : "MySQL extractor",
"isActive" : false
}
{
"_id" : ObjectId("5716054bee6e764c94fa7ddd"),
"name" : "MongoDB extractor",
"isActive" : true
}
]
|
Documents in Strict Mode |
[
{
"_id": {
"$oid" : "764c94fa7ddd5716054bee6e"
},
"name": "MySQL extractor",
"isActive": false
},
{
"_id": {
"$oid" : "5716054bee6e764c94fa7ddd"
},
"name": "MongoDB extractor",
"isActive": true
}
]
|
Mapping |
{
"_id.$oid": {
"type": "column",
"mapping": {
"destination": "id",
"primaryKey": true
}
},
"isActive": "isActive"
}
|
Output |
extractors
id (marked as PK) | name | isActive |
764c94fa7ddd5716054bee6e | MySQL extractor | (empty string) |
5716054bee6e764c94fa7ddd | MongoDB extractor | 1 |
|